Of all the issues you may encounter with your WordPress site, not being able to log in seems the most hassle. At least with the other issues, you can actually get inside your account. With login problems, you’re completely locked out.
As with any other WordPress issue, you have to first determine the problem before taking action. And even when you start altering codes, changing FTP files, or deleting or editing something, you have to know exactly what to tweak. Or else, more problems for your site. If you can log in for various reasons, check this list for what it could be and perform the accompanying solution.
Problem #1: Forgotten or lost password
No two passwords in any site should be the same. Definitely your WordPress website shouldn’t share the same password with any of your other accounts. However, it could lead to this exact problem especially if you’re logged in most of the time and don’t go putting your details every time.
This isn’t the solution for this problem (we’ll get to that in a bit), but here’s a tip! Once you’re out of this dilemma, make sure to use a password manager like LastPass.
Solution: Edit your login password from the database
First off I have to mention the most obvious and probably the easiest solution to this, which is the “Lost your password?” button on the login page. It’ll send you a link to your email where you can reset your password.
Now for those who can’t access the login page at all, you can edit your password from the database itself through phpmyAdmin. When you go to your database, access the users table named “wp_users”. That is unless you changed the default “wp_” prefix to something else. In that case, it might be called “[yourownprefix]_users”.
Select on a user you want to change the password for, click ‘Edit’. Enter your new password in the textbox next to “user_pass”, making sure to select md5 in the dropdown menu.
Problem #2: Problems with Cookies and Cache
Cookies are little files of data about how you interact with websites that’s saved in your browser. Some websites require cookies for them to function well and be accessible. When you don’t enable cookies, it might interfere with the website’s ability to do its normal functionalities properly, and also disable you from logging into your WordPress site since it needs cookies for the login.
Similarly, cache is also small files that are essential in accessing certain web pages. They’re less permanent because some cache may become outdated over time. If they’re not updated, you may see old versions of web pages that should no longer be available.
Solution: Enable Cookies, Clear Cache
This is one of the easiest things to resolve because the problem is not about WordPress itself. Most of the time, it’s all in the settings you have in your browser. Make sure that you enable cookies, and that you clear your cache regularly.
If you use a Mac, you can easily find this setting on Preferences of Safari. You should also clear your browser data every now and then to clear up the cache. Some websites may just take more time to load the next time you access them, but it should still let you log into your WordPress account.
Problem #3: Syntax Error
WordPress may be popular for the ability to customize it flexibly, but it also makes a lot of room for syntax errors. They appear even at the slightest mistake in coding, especially when you add your own code snippets to alter a small aspect of your site.
Solution: Fix code error via FTP
If you can’t access your Admin page or it gives you an error message, note down the error code that’s given. If you already know the code that’s making this error happen, go change that in the FTP. If not, search for the error code as it references the code that’s causing the problem.
Problem #4: Error Caused by Domain Change
If you rebranded and changed your domain or if you worked with a plugin that required domain information, a couple of things could happen: the login page may show a 404 not found page, you may be redirected to a different url, the entire page will refresh, or it may simply tell you, “This site does not exist.”
Solution: Match all domain information in your site’s settings
When moving your site or doing anything that affects the URL information, it’s very important that your domain remains consistent with your site’s general settings. You can make sure this is constantly true by accessing “wp-options.php” from your phpMyAdmin.
Problem #5: Problem with theme
Sometimes, your website’s theme can also cause some login problems. If you’re shown a blank page or your site doesn’t look like its usual layout when you go to the URL, it means your theme is all messed up. It’s probably the reason why you’re having trouble logging in.
Solution: Activate a default WordPress theme
The best course of action for this is to disable your current theme, and activate a default one from WordPress. As you can’t access your Dashboard, you need your FTP to alter the theme.
In FTP, go to “wp-content/themes”. You should see all the themes that are installed in the WordPress site currently. Right-click on the theme that’s causing the problem (or the one that’s in use) to rename it to something else. It should return back to the default theme that’s installed. If you can access the login, fix your theme immediately to get your site back to its original appearance.
Problem #6: Plugin complications
Similar to the theme, plugins can also give you problems with logging in for various reasons. Most of the time, it’s because one’s not updated or some are clashing with other plugins. This is a bit easier, but it may be time-consuming because you have to figure out which plugin or plugins are causing the problem first before you actually get to a solution.
Solution: Deactivate all your plugins
The best way to figure this out is through a trial and error process. First, disable all your plugins via FTP. This is essential so you could have access to wp-admin. Once you’re in, enable one plugin at a time, checking to see if it causes an error to the site or locks you out of the Admin page again. Once you’ve identified the problematic plugin, resolve that by updating, deleting, or looking for another similar plugin that works well for your site.
Problem #7: Corrupted or deleted login file
For some reason, sometimes the login file can become corrupted. Or, you or one of the users with access to the FTP could have accidentally deleted it.
Solution: Fix or re-upload a new login file
For safety, backup your WordPress. Download WordPress again from wordpress.org. Once it’s done, get the wp-login.php file and put it in WordPress install in the FTP.
This should do the trick and you may access your login page again. If not, change this line in the code,
$user_login = $user_data["user_login"];
$user_login = $user_data->user_login;/
Problem #8: Mismatched WordPress URL and site URL
As I’ve mentioned earlier, all your URLs should be consistent throughout all your WordPress settings. Your WordPress URL is the reference url for all of your WordPress files, while site url is your website address. They should be the same, otherwise it will cause login problems for you.
Solution: Edit the URLs via FTP or set the URLs manually
There are a number of ways to edit your URLs, but the best way to resolve this is to locate the “wp_options” table in your FTP. If you open it, you’ll find a field called “siteurl” where you can manually change it by clicking on Edit field.
Being locked out of your site is no joke. It can be quite a hassle because it takes a long process of trying to identify the problem and then resolving it. This list of problems and solutions should be handy. Try them one by one if you don’t know what’s causing the problem to get through to the bottom of it.