Locked Out of WordPress? Here’s What You Need to Do

Locked Out of WordPress? Here’s What You Need to Do

Getting locked out of WordPress can be frustrating — especially if you don’t know why it happened and how to fix it.

Don’t worry, though! This article will show you everything you need to know and do when you get locked out of WordPress.

What to Do Before Fixing The Issue?

Before we start, there are a few things you need to do to make sure everything goes smoothly:

  • Restore a backup — getting locked out of WordPress can be solved by restoring a backup of your site. If you don’t have one, skip this step and check out other causes and solutions we’ve listed below.
  • Create a backup — before taking further action like making changes to the site’s database, it’s necessary to create a backup of your website in case any changes cause additional issues.
  • Install an FTP client — an FTP client like FileZilla can be used to access your web server through a local computer manually. If you don’t know what it is and how to use it, check out our complete tutorial.

8 Causes of Getting Locked Out of WordPress and How to Fix Them

There are several reasons why you could be locked out of WordPress. Here, we will show the most common examples and how to fix them:

1. Incorrect Login Credentials

One of the most common reasons for getting locked out of WordPress is simply using incorrect login credentials. Since these credentials are case sensitive and usually hidden while we type, it’s possible to get them wrong.

How to fix this?

Pay more attention as you type in your password, be careful with numbers and characters, and if you’re still struggling, consider using a password management app.

2. Password Does Not Work & Failed Password Recovery

At times you just can’t remember your password, or there’s a chance that someone has gained access to your website and changed it.

How to Fix This?

Usually, this can be fixed with a simple click on the “Lost Your Password?” button, but if that doesn’t work, you can also change the password from your hosting control panel.

Here we’ll show you how to do it with Hostinger’s hPanel and phpMyAdmin:

  1. Login to the hPanel.
  2. Scroll down and locate the database section, select phpMyAdmin.
  3. Once you’re in, click Enter phpMyAdmin and you’ll be redirected to the administration page. Select Structure, and scroll down to find wp_users.the administration page of phpMyAdmin
  4. Once you click on wp_users, you’ll see the login credentials of your site’s users on the next page. Select Edit.user editors in wp_users table
  5. Then, simply type in the new password in the user_pass column to change it. Make other changes as needed.
  6. Before you press Go to save the changes, change the Function value of your password to MD5. It’s used to encrypt your password for an additional layer of security.

3. Losing Administrator Privileges

In some cases, you might find yourself losing access to the WordPress admin area – you can’t log in, or your username doesn’t exist. This can happen due to a few reasons: site owners revoking your admin rights, or you could be a victim of a hack.

How to Fix This?

If it’s the latter, you have to directly add a new admin user to your WordPress database through phpMyAdmin. Here’s how:

  1. Login to the hPanel and open phpMyAdmin.
  2. Once you’re on the admin page, click on wp_users, then select Insert. (not yet fixed)
  3. Fill out the columns as needed and save changes. Pick an ID number that isn’t in use in the database, and keep user_status as 0.
  4. Once you save the changes, head to the left side of the screen and select wp_usersmeta table, then find Insert.wp_usersmeta's insert column to be filled out
  5. Fill in the columns with the following information:
    • unmeta_id – leave it blank as it will be generated automatically.
    • user_id – enter the ID number you’ve inserted in step three.
    • meta_key – type in wp_capabilities.
    • meta_value – add a:1:{s:13:”administrator”;b:1;}.
  6. Once you’re done, click Go and prepare to do the step again with the same information but type in wp_user_level in the meta_key and set the meta_value to 10 instead.
  7. Click Go once again to save the changes, and you’re all set! You can now login to WordPress with the new administrator user.

Make sure to insert the meta_value correctly. We suggest to write it manually instead of copy-pasting it to avoid any errors.

4. Too Many Login Attempts

This error can be caused by a plugin that limits the number of login attempts. It’s a great way to prevent brute-force attacks, but sometimes it backfires, and you’re the one getting locked out.

How to Fix This?

Naturally, the login form will work again after some time, but if you can’t wait, you can opt to deactivate the plugin through an FTP client. Here’s how to do it:

  1. Set up an FTP client through the hPanel. If you need help, check out this tutorial.
  2. Login to the FTP server and head to the Remote Site window.
  3. Scroll down and find the wp-content folder, select plugins.
  4. Right-click on the limit login attempts plugin, select Rename.
  5. Type in deactivate_ before the plugin’s name.how to disable plugins from an FTP server
  6. Save the changes, and you’re done — the plugin will be disabled, and you can log in right away.

5. Incorrect WordPress URL

If you’ve recently changed the domain name of your site, and you’re suddenly locked out of WordPress, you might want to check if there’s any inconsistency between your site URL and the one stored in MySQL database.

How to Fix This?

To solve this problem, all you have to do is update your database with the correct URL. Refer to our comprehensive guide on how to change your URL in a MySQL database by using phpMyAdmin here.

6. Error Establishing Database Connection

Unlike other errors where you can’t log into WordPress, this one affects your entire site. It can’t connect to the database, therefore you can’t do anything. This usually happens because there’s something wrong with the database, a bad server, or corrupted files due to poorly working plugins, for instance.

How to Fix This?

There are a couple of things you can do to fix this:

  1. Activate the built-in WordPress repair configuration, or check the database settings through your hosting control panel. Check out our step-by-step tutorial for assistance.
  2. If those two methods aren’t working, try to disable all the plugins you’ve installed before the incident with the steps mentioned in the fourth issue.

7. White Screen of Death (WS)

If you ever find yourself staring at nothing but a white page on your WordPress site, then you may be experiencing this problem. The reasons behind this issue vary from bad plugins to insufficient website memory.

How to Fix This?

Here are some options to solve it:

  1. Increase your site’s memory limit.
  2. Disable all the plugins you’ve recently installed through an FTP client.
  3. Install a default WordPress theme through phpMyAdmin.

Check out our detailed tutorial on how to fix the WordPress white screen of death if you need more detailed steps.

8. Parse Error: Syntax Error

If you see the “parse error: syntax error” as you try to access your site, then the culprit is definitely incorrect code. As even a single misplaced letter can trigger this error, it happens to be very common, and can be easily fixed!

How to Fix This?

There are a couple of things you need to do to fix this syntax error:

  1. Trace the source of error by checking if the code changes you’ve made recently are correctly inserted and use proper syntax.
  2. Fix the bad code with an FTP client. Refer to our comprehensive guide on how to debug and fix WordPress syntax parse errors.

You can also determine the source of errors by opening your site on any browser and waiting for the syntax error message to appear, it will show you a full path of the error.


Now you know the reasons why you might get locked out of WordPress and how to fix them! Let’s quickly recap everything we’ve learned:

  • Incorrect Login Credentials — type in your password more carefully, or use a password manager app for secure and hassle-free logins.
  • Password Doesn’t Work & Failed Password Recovery — if regular email recovery doesn’t work, change and create a new password through your hosting provider’s control panel.
  • Losing Admin Privileges — create a new user in the database through phpMyAdmin.
  • Too many Login Attempts — to try and log in right away, disable the plugin that prevents you from logging in with an FTP client.
  • Incorrect WordPress URL — this happens because of a domain, or URL change. Update your database with the new URL through phpMyAdmin.
  • Error Establishing Database Connection — check if there’s something wrong with your database through your hosting control panel, or disable bad plugins and themes.
  • White Screen of Death — increase the site’s memory limit, disable bad plugins, and set the site’s theme to default.
  • Parse Error: Syntax Error — determine the source of the error, and fix it with an FTP client.

There you have it. Not as complicated as you’d think, right? If you follow all the instructions correctly and make sure to backup your site before doing anything, you’ll be able to access it again in no time. Good luck!

The author

Domantas G.

Domantas leads the content and SEO teams forward with fresh ideas and out of the box approaches. Armed with extensive SEO and marketing knowledge, he aims to spread the word of Hostinger to every corner of the world. During his free time, Domantas likes to hone his web development skills and travel to exotic places.