What to Do When You Are Locked Out of WordPress Admin

As a webmaster with over 15 years of experience, I know how frustrating it can be when you suddenly find yourself locked out of your own WordPress site. Believe me, it used to happen to me all the time in the early 2000s when WordPress was just getting off the ground!

Not being able to access your WordPress dashboard is like getting locked out of your own house. You‘re left stranded on the front porch, locked out with no way to get your hands on the keys.

According to recent statistics, over 4 million WordPress sites get hacked every year. And many of those hacking attempts aim to lock the rightful owner out by changing admin passwords and locking down access.

So don‘t panic! I‘ve been there myself, and I promise there are solutions for taking back control of your site.

In this detailed guide, I’ll share the exact troubleshooting steps I’ve learned after 15+ years of managing WordPress sites. Just work through these fixes one by one, and you‘ll regain access to your precious site in no time.

Why Might You Be Locked Out of Your Dashboard?

Before jumping into solutions, let‘s look at some reasons you could get locked out of wp-admin:

  • You entered the wrong password. Hey, it happens! Double check that caps lock is not on.

  • A plugin or theme is causing conflicts. Some plugins modify login behavior or include vulnerable code that gets exploited by hackers.

  • Your site URL changed. If the Site URL in your WordPress settings doesn‘t match your current domain, it can definitely cause login issues.

  • Server configuration problems. Complex errors like 500 or 403 statuses indicate issues on your web host‘s server that only they can fix.

  • A security plugin blocked you. Plugins like WordFence provide important protection, but occasionally they will block the rightful owner by accident.

  • Your site was hacked. Unfortunately, over 1 million WordPress sites get hacked every year. Attackers often change passwords and disable admin accounts.

12 Actionable Ways to Get Back Into WP-Admin

If you‘re locked out of your dashboard, don‘t panic! Here are 12 troubleshooting steps that can get you back in:

1. Double Check Your Password

I can‘t tell you how many times I‘ve been locked out myself simply because I was typing the wrong password or my caps lock was on. It never hurts to slow down and carefully verify your password before proceeding.

2. Reset Your Password

If you have access to the email address associated with your WordPress user account, you can reset your password easily. Just use the "Lost your password?" link on your login screen, and follow the reset instructions emailed to you.

3. Try Another Browser or Device

Sometimes software or browser conflicts can interfere with accessing wp-admin. Try clearing your browser cookies and cache and attempt logging in using a completely different web browser or device like your smartphone. This can bypass caching issues.

4. Disable Plugins via FTP

In my experience, plugin conflicts are one of the most common reasons for getting locked out. You can quickly deactivate all plugins by renaming the "/wp-content/plugins" folder to something like "/wp-content-plugins-old" via FTP. Just remember to rename it back later.

5. Switch to a Default WordPress Theme

Just like plugins, issues with your existing theme‘s code can also block access within wp-admin. Switching to a default built-in theme like Twenty Twenty using FTP is an easy way to test if your theme is the culprit.

6. Update Your WordPress Site URL

This has caused me login headaches many times over the years! If your site recently moved to a new domain, you MUST update the WordPress Site URL values under "Settings > General" so the addresses match. Since you can‘t access the dashboard, you‘ll need to modify these in the wp_options table of your database.

For example, you can use phpMyAdmin to edit the siteurl and home values to match your new domain. Once the URLs are aligned, you should be able to log in again.

7. Contact Your Web Host Support

If you‘re seeing complex errors like 500, 502, or 403 codes, there are likely server configuration issues at play. You‘ll need to open a support ticket with your WordPress web hosting provider and ask them to look into server logs and resolve any misconfigurations.

8. Look For Files Created by Hackers

According to Sucuri, hacked sites have an average of 56 malicious files installed on them by attackers. Carefully look through your file manager via FTP for any suspicious new files that weren‘t there before. The filenames may have random strings of letters or numbers. Removing those hacked files can help you regain access.

9. Scan for Malware and Suspicious Code

When a site gets hacked, attackers often inject malicious code or backdoors into existing files. Use a malware scanner like Sucuri SiteCheck to detect any code that was added without your knowledge. Removing this can clear the way to access your dashboard again.

10. Remove the User And Create a New Admin

If your admin user account has been compromised, deleting the problematic user from the WordPress users table via phpMyAdmin, then adding a brand new user with admin privileges can get you back in securely. Just be sure to choose a very strong password this time around!

11. Restore Your Site From a Backup

If all else fails, restoring your entire site from a recent backup before the lockout occurred is often the most thorough way to reset everything. A restore will allow you to easily create a new admin user, reactivate plugins, and recover your site to normal.

12. Prevent It From Happening Again

Once you regain access, here are some tips to avoid getting locked out again in the future:

  • Use very strong passwords that would be nearly impossible to hack. I recommend random strings of 12+ characters.
  • Limit login attempts to prevent brute force login attacks.
  • Setup two-factor authentication for an extra layer of security on your account.
  • Regularly backup your WordPress site so you can restore if needed.
  • Carefully vet any new plugins or themes before installing them.
  • Keep WordPress and plugins updated to the latest versions.

Don‘t Panic! Stay Calm and Keep Trying Solutions

I know it‘s frustrating when you suddenly can‘t access your own site. But stay calm, take a breath, and work methodically through these troubleshooting tips.

There is almost always a solution to regain access to your WordPress dashboard – so hang in there! If you methodically try each fix, you‘ll unlock the keys to your site once again.

Let me know if you have any other questions! I‘m always happy to help a fellow webmaster recover from a lockout.

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.