You’re excited to create your next blog post. You can’t wait. But oops! You can’t log in to the wp admin dashboard. You try different solutions, but they don’t work. You get really frustrated and want to throw in the towel.
Worry not. We’ve got you covered. You can fix this issue with a few simple steps. Let’s check out different possible problems and how to fix them.
The Problem Caused By Browser Cookies And Cache
You can’t log in to WordPress if you’ve disabled or there’s a problem with your browser cookies.
What are these cookies anyway? When you visit different websites, they store messages in your browser in small files called cookies.
Your browser cache can also be bringing issues. To reduce server lag, your browser has a temporary area where it stores recently downloaded pages known as a cache. This enables you to quickly go back to pages without having to download them again.
When you can’t log in to WordPress, this is the simplest and fastest solution that can be implemented by anyone, even with zero technical knowledge: Clearing your browser cookies and cache.
It takes just a few seconds, and it can cure your headache.
Try this first before you do anything else on this page. Here are three simple ways to fix cookie and cache issues.
Clear the Cache
If your cache is not functioning properly, you may be looking at older WordPress files, and therefore you can’t log in. Clear your cache.
We’ll illustrate this using Google Chrome. Here’s how to clear the cache on other major browsers. Back to Chrome, open your browser and follow these steps.
- Go to Settings > Advanced > Privacy and Security. Select “Clear browsing data”. (or press Ctrl+Shift+Delete on your keyboard at the same time)
- Select “Cached images and files”
- Click on “Clear data”
There are high chances that your cookies are already enabled. If you deactivated them for any reason, enable them right away. On Google Chrome, here’s how you do it:
- Go to Settings > Privacy and Security > Site Settings > Cookies and site data.
- Select “Allow sites to save and read cookie data (recommended)
Clear Your Cookies
An issue with these little cookies may give you login problems. Clear them this way on Google Chrome (if you’re using another browser, use this guide):
- Hold Ctrl+Shift+Delete at the same time on your computer keyboard or navigate to Settings > Advanced > Privacy and Security and select “Cookies and other site data”.
- Click on “Clear data”
Clearing browser cookies and cache may quickly resolve this problem. However, if the problem persists, go to the next fix.
Blank Page Or Php Error Message
Are you getting a blank page or a PHP error message? That may be the reason why you can’t log in to the WordPress admin dashboard.
You can do this in two ways:
- Using an FTP client
- Using cPanel
Here’s a video on how you can solve this using an FTP client.
However, in this tutorial, we’ll guide you on how to disable themes and plugins easily using your host’s cPanel. Let’s go:
Deactivate All Plugins
Log in to your cPanel then navigate to File Manager.
Go to public_html and select the site you want to edit if you have multiple sites hosted on the same server. If it’s just one site, you’ll just go to public_html and proceed as follows.
Open the wp-content folder and go to plugins.
Double click on that to open it. You’ll see a list of installed plugins.
Rename each of these plugins. You can do so by adding something like “1” at the end. For example, let’s rename “Akismet” by right-clicking then selecting “Rename”.
Make it “Akismet1”.
When you rename a plugin, WordPress will no longer be able to read it. This way, it will be deactivated on the back end. Here’s what we’ve done to Akismet:
Use these steps to rename all your plugins. This will deactivate them all.
If you don’t want to rename them one by one, you can rename the entire “plugins” folder. To do this, go back to “wp-content” and navigate to “plugins” like this:
Right-click and rename it to something else e.g., “plugins1”.
If plugins are the cause of the problem, this will fix the problem.
You will then be able to log in and activate the plugins one by one as you check to see which one was causing the issue.
Still not working? Let’s check your theme next.
Revert To Your Default Theme
Theme-related issues may make it impossible for you to log in. To fix this, you’ll need to deactivate your current theme. That will automatically take your site back to the default WordPress theme.
You can do this using an FTP client or cPanel. Let’s use cPanel as well here since it’s faster and doesn’t need any installations on your computer.
Here are the steps:
- Log in to cPanel then navigate to File Manager > public_html.
- Go to wp-content locate the “themes” folder.
- Double click on this to open it and view your themes.
- Rename your active theme so that WordPress can’t read it.
WordPress will revert your site to its default theme.
And that will fix the issue if the active theme was the problem.
From here, you’re free to delete the active theme and replace it with a fresh install. Or you can look for another theme.
These fixes will get you to the login page. However, you’ll need to use the correct email address (or username) and password to log in.
If you’re using what you think is the correct password and it doesn’t work, then you’ll still not be able to access your site. What do you do in that case? Read on to find out.
When Usual Wp-admin Password Resetting Does Not Work
The first and most obvious thing to do when your password is not working is to reset it. You do this from your log in page.
To go to your WordPress page, the default path is to add /wp-admin to your browser’s URL. If your site’s URL is example.com, then you can log in using example.com/wp-admin.
When there, click on “Lost your password” to reset it.
You’ll get an email with password reset instructions.
If this doesn’t work, don’t worry. Here’s exactly what you can do:
Reset Password By Editing functions.php File
The functions file is used by themes to load both front-end and admin pages of WordPress sites. It defines functions, actions, classes, and filters used by other theme templates.
You can use this handy file to reset your WordPress password. Here’s how:
Go to your cPanel or FTP client to locate the functions.php file. This should be under public_html > wp-content > themes
Double click to open it then locate the functions.php file.
Right-click and download it.
Edit this file and add this code at the beginning, right after the first <?php:
wp_set_password( ‘password’, 1 );
Enter your new password here. The number “1” here denotes the first user (main admin) in the wp_users table.
Let’s say you want to use happytoday123 as your new password. Here’s how it will look like in the code.
wp_set_password( ‘happytoday123’, 1 );
Upload the modified functions.php file back to your site (on the same folder where you downloaded it from).
Important: When you’re able to log back in, go back to functions.php and delete that code. If you don’t, it will keep resetting your password in each page load.
Reset Password By Editing Phpmyadmin Database
In the back end of your hosting, you’ll get phpMyAdmin. This is free, open-source software. It helps you in the management of MySQL users and their user privileges.
You can also reset your password using phpMyAdmin.
Back up your website before doing this. Here’s a step by step process on how to reset your WordPress password using this software.
Go to cPanel then navigate to phpMyAdmin.
Click on “Databases”
Select your WordPress database.
Click on the table that has _users on it. By default, it should be wp_users. However, in some cases, it may have something else before the _users.
Click on the edit button next to the admin user:
Go to “user_pass and enter your new password.
On “varchar(255)”, click on the dropdown arrow and select “MD5”. Click on “Go”.
You can now log in to WordPress using the new password you’ve created.
WordPress Login Redirect Loop: The Page Keeps Refreshing And Showing 404 Not Found Error
Is your site showing this annoying error? You simply can’t log in to WordPress admin no matter how you try. The page keeps looping and showing you a 404 error. Or it just loops back to the login page.
This video shows you how this looks like.
When this happens, you can use the steps in this guide to clear your cookies and cache first. If it persists, deactivate your theme and plugins.
Here’s what to do if you’re still unable to log in after this:
Delete .htaccess File
If there are issues with this file, you may experience login problems. The good news is you can delete this file and recreate it in a few simple steps. Here you go:
In your FTP or cPanel, go to your files and navigate to public_html.
If you have multiple sites on your hosting, choose the site you’re editing. If you have just one site, this will show by default. Either way, here’s the .htaccess file.
Right-click and delete it.
You should now be able to log in.
Once done, immediately navigate to Settings > Permalinks.
You don’t need to touch anything here, just click on “Save Changes”.
WordPress will generate a new .htaccess file, and all will be well from here.
Update Site URL
There are instances where updating your site’s URL will fix the looping and redirecting issue. Here’s how to do it:
Back up your site before starting this process.
Log in to your site using your cPanel or FTP client. Go to public_html then locate the wp-config.php file.
Right-click and select “Edit”.
Now, add these two lines of code. Remember to replace example.com with your site’s URL. Include “www” if your site has it. Here are the lines of code you need to add:
Save changes. This should resolve the issue.
Corrupted Login File
You can’t log in to WordPress if you have a corrupted log in file. If all the other steps in this guide don’t work, then you’ll need to check if this file is alright.
The file we’re referring to here is called wp-login.php. You need to make sure it’s not corrupted or deleted.
Here’s how to go about it:
- Back up your site.
- Navigate to public_html through cPanel or your favorite FTP client then locate the wp-login.php file. By default, it should be at public_html > wp-content.
- Right-click and delete it.
- Download the latest WordPress version. Open it and trace the wp-login.php file in this fresh download.
- Upload this to your site to replace the one you deleted.
- Use the search button to locate “Redefining user_login”.
- Delete this code:
- Replace it with:
- If the login file had an issue, this would do the trick.
$user_login = $user_data[“user_login”];
$user_login = $user_data->user_login;
This exhaustive guide shares powerful tips for anyone who can’t log in to the WordPress admin dashboard. Here’s a quick recap of what you need to do to sort out this problem:
- Make sure your cookies are enabled. Clear your cookies and delete your browser’s cache.
- If you see a blank page or PHP error message, deactivate all plugins and revert to your default theme.
- Is your password not working, and you can’t reset it? Do so from the back end by editing the functions.php file or resetting it via phpMyAdmin.
- In case the WordPress login page keeps looping and redirecting, delete the .htaccess file from cPanel and replace it through Settings > Permalinks. Or simply update your site’s URL through the wp-config.php file.
- Replace a corrupted wp-login.php file.
With these simple steps, you’ll be able to log back into your site and do what you love most.
Other Tutorial Guides:
- Ultimate WordPress Security Guide
- Install WordPress on Windows: Ultimate Step by Step Guide
- How to Create the Best WordPress Staging Site
- How to Make WordPress Site Live
- How to Discover & Recover WordPress Site
- How to Add Custom Fonts to WordPress
- How to Speed Up WordPress Site
- Wix vs WordPress: Platform Crucial Differences