Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

What To Do When You Are Locked Out of WordPress Admin (wp-admin)

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
What To Do When You Are Locked Out of WordPress Admin (wp-admin)

This past weekend, we had a user who was locked out of WordPress Admin panel of their site. While we had written numerous articles covering each specific issue, we realized that we should combine all of them at one place to make it easier for others. In this article, we will show you what to do when you are locked out of WordPress Admin (wp-admin), so you can regain access to your site.

There are few reasons why you could be locked out of WordPress admin, so let’s take a look at each of them one by one. Hopefully through this process of elimination, you will be able to figure out the solution for your problem.

Error Establishing Database Connection

Are you seeing this error on your entire site? The reason why you get this error is because WordPress is unable to establish a database connection. This could happen for various reasons. It could happen if your database got corrupted for some reason. It could happen if your web hosting server is having some issues. If this is your issue, then please refer to our guide on how to fix the error establishing database connection in WordPress.

White Screen of Death

Are you seeing a white screen on your WordPress admin? This issue is often referred to as the WordPress white screen of death. It usually happen because you exhausted the memory limit. It could be caused by a poorly coded plugin or theme. It could also be caused by unreliable web hosting. If you are seeing this error, then please refer to our guide on how to Fix the WordPress white screen of death.

Incorrect Password Issue

Sometimes, even when you are typing the correct username and password combination, you won’t be able to login. When you try to reset your password, you never receive the email. This can happen if you were a victim of a hack. We would recommend that you reset your WordPress password from phpMyAdmin.

This method can be a bit overwhelming for new users, but this is your best bet.

Lost Admin Privileges

Sometimes, you may be able to login to your WordPress admin, but you don’t see any of the admin functionality. For example, no plugins, no themes etc. This could happen if your user permissions were modified. Often this happen due to a hack. Hackers would infect your site, and then delete your admin privileges. In this case, you should add an admin user to the WordPress database via MySQL (phpMyAdmin).

PHP Errors (i.e Syntax error, unexpected function etc)

These PHP errors usually happen when you are pasting the code from a website. Often beginners use the built-in WordPress editor from their dashboard. While that feature is pretty handy, but if you don’t know what you are doing, then it can be a disaster. If you pasted a code from a website which locked you out of your WordPress admin, then the first thing you need to do is take a deep breath. Now the only way to fix this issue is using a FTP program (How to use FTP). Once you have installed the FTP program, login to your site. Go to the theme file that you modified. Most likely it was the functions.php file. Now get rid of the code that you added in there. Re-upload the file, and you should be good to go.

Before you go on the site and comment “this code broke my website”, please refer to our beginner’s guide to pasting snippets from the web into WordPress. This is just to prevent you from looking like a fool on the web. Often its hard to admit that the mistake might be yours, so make sure of that first before you point the finger at someone else.

Hopefully after going through all of these possible scenario’s, you have already fixed your site. If one of these solutions helped fix your issue, then please let us know in the comments. If you have a solution that is not mentioned in this article, then please share it in the comments as well.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. Simon says:

    You left out how to get in if the password is being sent to an email you no longer control…

  2. Ashley says:

    Hi normally when ever i go online to my website, it is normally already logged in to wp-admin. A couple days go i tried to go onto it and it was logged out. So i try to log in and this was unsuccessful. I try logging in using wordpress..this also didnt work. I get this error – ‘Error, invalid response data’. What can i do to fix this problem?

    Thank you in advance

  3. Marie Krebs says:

    No matter how I try to access my dashboard, I get a simple white page with the word “error” in the upper left hand corner. I’m seeing the error :locked out due to too many login attempts” but I haven’t logged into my account AT ALL in over a month.
    iThemes seems to cause more trouble than offer any security, because the spam comments and constant “new user registrations” keep coming, but my legitimate access of my dashboard is denied.
    NOW WHAT?!?! Thanks!

  4. Billy Helton says:

    I had someone to build me a site. Well he did and messed me over on it. He set my privileges to certain things and really did a crappy job with my site. I can’t do anything to it or with it. He has administrator privileges and Won’t let me have them. Is there a way to take it over change passwords and have control of my site? I have paid him all I intend to which was an agreed upon amount. I just want a way to have full control of my site.

  5. Brenda Punchak says:

    I constantly have someone hacking into my site. They apply words into my content that leads to other sites selling cigarettes etc… I have had numerous different experts fixing it, but it never lasts. It is being hosted through Godaddy. I have also called them, but they keep trying to sell me more security. The experts I hired have added different security, but it doesn’t seem to last. My contact form doesn’t work either, when you fill it out it always says failed to send. I don’t know what else to do. Please help. This website is costing me a fortune.

    • WPBeginner Support says:

      Hey Brenda, we are going to publish our complete step by step WordPress security guide in a couple of days. Please subscribe to our blog or follow us on Twitter or Facebook so that you are notified when we publish it. It will help you learn how to secure WordPress like a professional.

  6. Stephanie Reinicke says:

    i messed up my code in the functions php and can’t access my site anymore. Sadly i was stupid enough not to save a copy of the original code. What shall i do? Any suggestions ? Being new to all this, im kind of desperate ;)

  7. Jip says:

    I messed up the functions section and now the site is broken and apparently I can’t change the code in my WordPress admin. I also can’t access the site via the FTP program (it can’t connect me to the server) and I don’t know what to do.

    • WPBeginner Support says:

      You can also access your website using File Manager. It is a web based FTP program that you can access from your web hosting dashboard. Simply login to your hosting account and on the cPanel dashboard look for File Manager.

      You can also contact your hosting provider to help you fix this issue, or send you FTP credentials.

  8. darshana says:

    i my problem is my website suddenly is not opening and its now showing password and a tab it was working properly till this afternoon and suddenly it was like that the site is asking for password not event letting me go to the wp-admin page. kindly help

  9. Ashish Khokhariya says:

    Awwww… Great…..

    Thank you…Thank you ….Thank you so much

    Went to exactly same problem as you mentioned and overcome by following steps mentioned by you…

    U R Great ….Thank you again

    God Bless you

  10. Hardik Lamichhane says:

    Hello there,
    My problem is falls on this topic but I’m facing another problem when I try to login my admin panel dashboard. It shows simple Page Not Found error and shows redirection search page.
    Please fix.

  11. fern says:

    my dashboard url redirects me to pleas how do i solve it

  12. Cyrus Ong'au says:

    I recently installed a plugin to a website I am currently designing for a client and now am locked out of the wp-admin area. I cannot be able to login to the site’s C-panel so that maybe I can delete the plugin. The error that shows up is:
    Fatal error: Call to undefined function et_get_option() in /home/firetech/public_html/wp-content/plugins/DiviLogin/main.php on line 19
    How do I get out of this.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.