WordPress Login Not Working? Try These 14 Fixes for the “Can’t Access WP-Admin” Error

Jan 08, 2024  | How ToWebsite Maintenance

Is your WordPress login not working properly? We feel your pain. Like losing your house or car keys, getting locked out of your WordPress site is a nightmare.

You’re trying every password you can think of, and your digital doorman’s still blocking you.

The more time you spend locked out, the less time you have to get things done. What if you need to update your product range, change pricing, or post new content?


GIPHY

Thankfully, it’s a pretty common issue that doesn’t take much time to fix – if you know where to start.

We’re here to help you find out why you’re locked out, how to regain access to WordPress, and how to prevent this problem from happening again.

Why Is My WordPress Login Not Working? 13 Common Reasons

If your WordPress login is not working as it should, it’s usually one of the following culprits:

  1. It’s a cache or cookie issue
  2. Your login credentials are incorrect
  3. There’s a problem with your .htaccess file
  4. Your plugins are faulty or are blocking you
  5. Your theme is faulty
  6. Your WordPress admin login URL has changed
  7. Your website was hacked
  8. There’s a deeper WordPress error
  9. Your memory limit is too low
  10. Your login file corrupted
  11. There’s a PHP syntax error or a parse error in play
  12. Your database isn’t connecting properly
  13. Your file permissions are incorrect

Don’t worry if this sounds complex – help is coming further down in our guide, where we show you how to fix each problem in this order.

14 Ways To Fix the “WordPress Admin Login Not Working” Issue

Let’s get straight into diagnosing and fixing your WordPress login issues.

Before you start, make sure you’ve saved a backup of your site. Ideally, you should already be using automated backups!

Remember that you might need access to an FTP or File Transfer Protocol client, such as Cyberduck. An FTP client gives you access to WordPress even when you can’t log in through the usual means. Ask your web host for FTP login credentials.

We’ve arranged our WordPress login fixes in the following order and categories:

  1. Common fixes, which you can try for yourself
  2. Fixes to try next, which take a little more effort
  3. More technical fixes, which are easier with a professional’s help
  4. Contact an expert, or who to contact if all else fails

Many of these fixes also help reverse the frustrating WordPress login page refreshing and redirecting issue, a variation of the error you’re experiencing.

Remember, if you don’t have time to investigate or fix the problem yourself, or if you feel uncomfortable making changes to your website, help is always available. Skip to our section on reaching out to an expert to learn more.

Ready to get back into your WP admin area?


GIPHY

Let’s go!

Common fixes for WordPress login page not workingSummary
1. Clear your cache and check your cookiesErase all your browsing data and reload your web browser
2. Reset your password and create a new adminTry resetting your password via the login page or reset it manually through phpMyAdmin, where you can also create a new admin user
3. Delete and restore your .htaccess fileLog into FTP, delete your .htaccess file, and if you can log into WordPress, head to “Settings,” then “Permalinks,” and “Save”
Fixes to try next 
4. Check your plugins and themeRename plugins via FTP one by one to deactivate them and check if you can log in; do the same with your themes folder
5. Check and fix your site URLOpen wp-config.php in your FTP and insert the URL fix code
More technical fixes (easier with a professional) 
6. Check for a hack or security breachHead over to our guide on what to do if your WordPress site is hacked and check for evidence of hacking
7. Diagnose and fix a deeper errorConsider if other errors are in play by using our step-by-step error guides linked below
8. Increase your PHP memoryIncrease your memory limit by editing the wp-config.php file in FTP
9. Restore your WordPress login fileDownload the latest version of WordPress and copy its wp-login.php file over to your FTP root folder to replace it, then edit its code
10. Fix a PHP syntax or parsing errorChecking plugins and themes usually fixes this error, so contact your host or a developer if the problem continues
11. Repair wp-config.php and reconnect your databaseReconnect your database and verify your host’s database details match those in wp-config.php
12. Check file permissionsRestore file, folder, and configuration permissions through FTP by changing numeric values
13. Restore a backupManually upload a backup through FTP or ask your host for advice
Contact an expert 
14. Reach out to your web host or a WordPress developerContact your web host for support or a StateWP expert for a quick, long-lasting fix

Common fixes

You can try the following steps on your own.

More often than not, they fix login problems – but if the problem persists, keep reading for more help.

1. Clear your cache and check your cookies

Depending on your chosen browser, there are different ways to clear browser caches and cookies. Let’s assume you’re using Chrome.

Click the three dots to the upper right of your browser window and hover over “More Tools”:

Click “Clear Browsing Data” in the next menu.

Next, select “Cookies and other site data” and “Cached images and files” before clicking “Clear data.” Set the “Time Range” in the dropdown menu to “All time.”

Close and reopen your browser; try logging into WordPress again.

2. Reset your password and create a new admin

Head to the WordPress login screen as usual and click “Lost your password?” Enter your registered email address and wait for an email to arrive.

Follow the email to reset your password and try logging in again.

If you don’t receive an email or this method doesn’t work, you need to edit it through your web host’s dashboard via phpMyAdmin.

Let’s assume you use Siteground as a WordPress hosting provider for this step. Log into the Siteground dashboard and head to:

  1. “Site Tools”
  2. “Site”
  3. “MySQL”
  4. “phpMyAdmin”
  5. “Access phpMyAdmin”

Source

On the next screen, choose your WordPress database from the list on the left if you know its name. If you don’t, open wp-config back up and look for:

define(‘DB_NAME’, ‘user_wp743’);

 

Back in phpMyAdmin, click “SQL” at the top of the next page, which opens up a text field. Enter the following code as a query, replacing “PASSWORD” with your new preferred phrase.

UPDATE `wp_users` SET `user_pass` = MD5(‘PASSWORD’) WHERE `wp_users`.`user_login` = “admin_username”;

 

Click “Go,” and try logging in with the new password.

An alternative route is to head to “Site,” “MySQL,” and “Users,” and then click the three dots next to your desired user. Click “Reset Password” and follow the instructions.

If you still can’t log into WordPress admin this way, try adding a new admin user.

Follow the above steps again until you reach the main phpMyAdmin hub. Instead of clicking “SQL,” look for “wp_users” in the list of files.

appearance settings screen

Click it to open up the list of users registered.

To add another admin user, head to “Insert” in the top menu and fill out the following information:

  • ID: Choose any number
  • User_login: Set a username
  • User_pass: Create a password
  • User_nicename: Set a user nickname or full name
  • User_email: Add the user’s email address
  • User_url: Add your website’s address
  • User_registered: Set this user’s registration date
  • User_activation_key: Leave as is
  • User_status: Enter “0”
  • Display_name: Enter the name to display

 

Click “Go” to save the user and return to the file list again. Open up “wp_usermeta” and click “Insert” per the last step.

Fill in the fields like so:

  • Unmeta_id: Leave as is
  • User_id: The number you entered in the user add screen
  • Meta_key: Enter “wp_capabilities”
  • Meta_value: Enter “a:1:{s:13:”administrator”;s:1:”1″;}”

Then, scroll down to fill in the fields a second time:

  • Unmeta_id: Leave blank
  • User-ID: Same number again
  • Meta_key: Enter “wp_user_level”
  • Meta_value: Enter “10”

Click “Go,” and your new admin username is ready.

3. Delete and restore your .htaccess file

If you see the message “ERR_TOO_MANY_REDIRECTS” flash up when you try logging into WordPress, your .htaccess file is likely to blame.

Log into your cPanel or FTP file manager and look for this file in your root folder:

files in a FTP

Right-click and download the file, and then right-click again, selecting “Delete.”

Try logging back into WordPress. If successful, head to “Settings” and “Permalinks” in your dashboard, then scroll down and click “Save.”

Reupload your saved version of the .htaccess file via FTP into your root folder if the problem continues.

4. Check your plugins and theme

There’s a chance your WordPress admin login page is not working properly because of plugin and custom or default theme faults.

For example, it might be an overprotective security plugin, your regular plugins are faulty, or one or two have changed your login URL.

One option is to wait for your security plugin to unblock you. However, it’s best to manually deactivate it and other plugins that might be at fault.

Log into your FTP client, look for your root folder or public_html, and find the “wp-content” folder.

FTP screen

Open it and rename the “plugins” folder to something memorable.

You’ve just deactivated all your plugins – so try logging into WordPress again.

One or more plugins are at fault if you can log in without issue. Go through and reactivate each plugin in your dashboard’s “Plugins” menu and check if the login error persists in another window.

Alternatively, manually deactivate and reactivate plugins through FTP. Rename your plugins folder the original and then rename each plugin individually, checking for the error as you go.

Your theme may be causing the error if, for example, it uses a custom login screen or if core updates clash with custom code.

Simply follow the same process as above, but rename the “themes” folder in your root folder via FTP.

Then, try logging into WordPress again. Head to your dashboard’s “Themes” section and choose a new look.

Remember to rename your themes folder name in FTP after.

5. Check and fix your site URL

If you recently moved your website to WordPress or changed core files, there’s a chance your WordPress address URL or site address URL might be incorrect.

The quickest way to fix this is to log into your site with FTP and find the “wp-config.php” file. This database file contains important configuration details.

Warning! Editing wp-config.php this way means you can’t change your URL again via the dashboard once you have access.

Look for the file in your root directory:

Right-click and download the file so you have a backup, then double-click to open it

Scroll to the bottom of the text file. You’re going to insert some code above the section marked:

“/* That’s all, stop editing! Happy publishing. */”

 

Above this line, add the following code, replacing “https://yourwebsitehere.com” with the correct URL for your WordPress site in both cases:

define(‘WP_HOME’,’https://yourwebsitehere.com’); 

define(‘WP_SITEURL’,’https://yourwebsitehere.com’);

 

Save the changes, and see if you can access your site again.

Experts agree that this is something of a temporary fix. If it solves the problem, that’s great! But there are more in-depth ways to fix the issue permanently. We recommend looking at WordPress’s official codex.

More technical fixes (easier with a professional)

This series of steps is the most technical you’ll need to attempt when trying to fix WordPress login problems. Feel free to ask for help if you get stuck!

6. Check for a hack or security breach

If you can’t log into your WordPress site after trying steps one through five, there’s a chance hackers changed your website details.

Checking for evidence of a hacking attempt and reverting changes can take time and effort – meaning you need to set an hour or so aside to run through some checks.

We have a complete guide on what to do if your WordPress site is hacked – be sure to leap over there to run through the checks and head back here if login problems continue.

7. Diagnose and fix a deeper error

WordPress can, unfortunately, fall prey to lots of errors, like the highly frustrating 403 error, that stop users from logging in.

For example, you might receive a message explaining there’s been a critical error, the dreaded 500 error, or problems caused by the 503 message.

You need to run through a few checks and make changes, where possible, through FTP.

We can help! Click the links above to find out more about fixing these errors.

8. Increase your PHP memory

Sometimes, your WordPress site’s memory limit prevents scripts from handling certain tasks. You might need to increase the default limit if your web host allows it.

Be careful! Raising your limit too high could create further problems, such as slowing your WordPress website down.

To start, check with your web hosting provider to see if you can raise PHP memory limits within the package you’ve set up with them.

To raise limits manually, log into your FTP client and open up wp-config.php.

Scroll down the code and look for the following:

define( ‘WP_MEMORY_LIMIT’, ‘128M’ );

 

Your memory limit here is 128MB. In this case, edit it to 256M, if you have permission. Save the file and try your login page.

9. Restore your WordPress login file

The wp-login.php file in your root folder typically sends you to your login page when added to your site’s URL. Sometimes, you might need to restore it completely to undo login errors.

Provided you’ve backed up your WordPress site, head to WordPress.org and download the latest version.

Open your download and copy the wp-login.php file.

Head to your FTP, find your existing wp-login.php file, and delete it. Right-click and paste your copied file from the download into the root folder, or drag and drop it across from the download window.

Then, open the new file and look for “redefining user_login” in the code. Below it, you should see:

$user_login = $user_data[“user_login”];

 

Delete that and replace it with:

$user_login = $user_data->user_login;

 

Save the file and close it. Try logging into your site again, and move to the next step if you still can’t access WordPress.

10. Fix a PHP syntax or parsing error

PHP syntax and parsing errors can occur when you use custom code or when plugins encounter problems.

We recommend avoiding using custom code in WordPress until you know it works as expected. Try using a code playground, for example, to test your programming and avoid errors. Using W3 Developer Tools and CodeSandbox to test and validate code is recommended.

If you’ve tested your plugins and themes and still face errors, contact your host for advice.

11. Repair wp-config.php and reconnect your database

At this point, it’s worth checking if your database connects to WordPress properly.

If you see the “error establishing a database connection” when you log in, like below, you need to make some manual changes.

We recommend you read our guide on how to fix the WordPress database connection error to tackle this problem thoroughly. However, here’s a quick solution for manually reconnecting your database through wp-config.php.

You need to check if the information in wp-config.php matches the database details in your host’s dashboard. Let’s assume you’re using Siteground for this step.

Log into Siteground’s user dashboard, look for “Site” and then “MySQL.” Then, click “Databases” to see a list of available ones.

Take note of your database’s name and click “Users” to check the names of users with admin access. If you’re unsure of the WordPress password for each user, follow the password reset steps in step two.

Again, note these details and head back out to FTP.

Open wp-config.php again and look for the following details in the code:

//** The name of the database for WordPress */
define( ‘DB_NAME’, ‘database_name_here’ );
/** MySQL database username */
define( ‘DB_USER’, ‘username_here’ );
/** MySQL database password */
define( ‘DB_PASSWORD’, ‘password_here’ );
/** MySQL hostname */
define( ‘DB_HOST’, ‘localhost’ );

 

Check that the details from Siteground match those in wp-config.php. Edit, replace, and save if they don’t, and try logging in again.

For the hostname, check with your host directly if this differs from the default “localhost.”

12. Check file permissions

Occasionally, upgrading WordPress or installing themes and plugins can cause permission errors.

Head to public_html or your root folder in FTP and right-click it, selecting “File Attributes.”

In the next window, you need to set permissions for your directories by typing in “755” or “750” in the numeric or permissions value box, checking “Recurse into subdirectories,” and selecting “Apply to directories only.” These details might appear differently depending on your FTP client:

Click “OK” and bring up the “File Attributes” window again.

This time, enter “644” or “640” into the value box, check “Recurse into subdirectories,” and mark the bullet for “Apply to files only.” Click “OK.”

The last step is to right-click wp-config.php and choose “File permissions.” Just enter “440” as “Numeric value,” then click “OK” and try logging into your website.

13. Restore a backup

Restoring backups is easy enough when you can log into WordPress, but it’s a little trickier manually.

You typically save your backups to your hard drive or the cloud so you can reupload them via your host’s phpMyAdmin and FTP.

The easiest way to get around this is to contact your host. They likely have backups available and could restore your site to a previous version.

Remember, restoring a backup from before the login error happened doesn’t stop it from recurring. If this step fixes the issue for you temporarily, check the issues that can trigger the problem and ensure it doesn’t happen again.

Contact an expert

If you’ve come this far, you’ve either exhausted the options above or would prefer a developer or expert to help you log back into WordPress.

Either way, there’s no harm in reaching out.

14. Reach out to your web host or a WordPress developer

Your web host can handle some of the more complex WordPress login fixes for you. This is especially handy if you can’t access your WordPress dashboard.

In some cases, you might not be able to access your host user dashboard. If so, it’s wise to reach out:

First, look for your web host’s “contact” page and explain your login difficulties and what you’ve done to fix the problem thus far.

Response times from hosts vary if you don’t have direct access to your dashboard, so be willing to give it a little time.

Alternatively, it’s faster and easier to reach out to a WordPress developer, such as an expert at StateWP.

However, if you can’t access WordPress, you can’t use our Proto dashboard to contact our team. But don’t worry – you simply need to email or call us instead.

We still aim to respond to and fix most WordPress problems within a day of you getting in touch. If any of the steps above are confusing or simply don’t work for you, pick up your phone or open your email and contact us.

WordPress Login Not Working? Time To Become a Digital Locksmith

Is your WP-admin not working as expected? With a developer at your side, you can avoid errors like these locking you out again.

Getting locked out of WordPress is a heart-stopping moment. With a WordPress login not working properly, it’s easy to feel stranded.

Thankfully, as you’ve seen, a few quick technical tweaks can get you back in lightning fast.

And, if troubleshooting doesn’t work or you’d rather ask for help from a seasoned WordPress developer, all it takes is a quick call or email to StateWP to help you back into your dashboard in a matter of hours. 


GIPHY

Now that you’re clear on how to regain access to WordPress, we recommend you read through our website maintenance checklist to keep your site fighting fit.

Then, if you’d like to know more about web hosts and how hosting works in practice, look at our layman’s guide for a deep dive.

x