Troubleshooting · Troubleshooting
How to Fix Being Locked Out of wp-admin in WordPress
Short answer
Start with the “Lost your password?” link on wp-login.php, because it is the fastest fix when email works. If no reset email arrives, reset the password in phpMyAdmin or with WP-CLI, then disable the security plugin by renaming its folder over FTP if a block is stopping you. Once you can log in, fix the cause, change the password to a strong one, and re-enable the plugin.
Key takeaways
- The login page is wp-login.php, and /wp-admin/ redirects to it when you are logged out.
- WordPress usernames and passwords are case-sensitive, so retype them exactly before trying a reset.
- In phpMyAdmin, set user_pass with the MD5 function in wp_users, and WordPress rehashes it on your next login.
- Renaming a plugin folder in wp-content/plugins deactivates that plugin without dashboard access.
- Wordfence can block an IP after too many failed logins, and its block page offers an email link to regain access.
- WordPress 6.8 hashes new passwords with bcrypt by default, as of November 2026.
What does being locked out of wp-admin mean?
Being locked out of wp-admin means you cannot sign in to the WordPress dashboard at all.
The dashboard is the Administration Screen, and the login page is wp-login.php in your site root. Visiting /wp-admin/ while logged out redirects to that login page, according to the Logging In handbook.
A lockout is not one single error. It can look like a rejected password, a page that sends you back to the login form, a “temporarily locked out” message, a 403 error, or a blank page.
| Symptom | Most likely cause | Start with |
|---|---|---|
| Password rejected | Wrong or forgotten password | Email reset |
| Login form reloads | Cookie or site URL problem | Clear cookies, check URLs |
| Temporarily locked out message | Security plugin block | Block-page email link |
| 403 Forbidden | IP block or bad .htaccess rule | Disable security plugin, check .htaccess |
| Blank page or critical error | Plugin or theme fatal error | Recovery Mode, disable plugins |
Why are you locked out of wp-admin?
The most common cause is a wrong or forgotten password, often after a password change on another device.
Other common causes are a security plugin that blocked your IP after failed attempts, a plugin that changed the login URL, a cookie problem, wrong site URL settings, a damaged .htaccess file, or a plugin that causes a fatal error. Work through them in order, starting with the least risky fix.
If the lockout followed a hack or a strange admin change, read the guide on how to recover a hijacked WordPress admin account before you reset anything, because the account itself may have been changed.
How do you reset your password from the login page?
Use the “Lost your password?” link on the login page, because it is the fastest fix when email works.
- Open
wp-login.phpon your own domain. - Click “Lost your password?” under the login form.
- Enter your username or the email address on the account.
- Open the reset email and follow its link to set a new password.
- Log in with the new password.
WordPress sends the reset link to the address tied to the account, as the Reset your password guide explains. Check spam if it does not arrive in a few minutes.
If no email arrives, do not keep requesting resets. That can create several links and add confusion, so move to phpMyAdmin or WP-CLI instead.
How do you reset your password with phpMyAdmin?
Reset the password in phpMyAdmin when email reset does not work and you have hosting panel access.
Back up the database first. A wrong edit in the database can break logins for every user, so export a copy before you change anything. The guide on how to back up WordPress shows the steps to take before a database change.
- Open phpMyAdmin from your hosting control panel and select your WordPress database.
- Open the
wp_userstable. Your table prefix may differ fromwp_. - Click Edit on the row for your admin user.
- In the
user_passfield, type your new password. - Select MD5 in the Function dropdown for that field.
- Click Go, then log in at
wp-login.phpwith the new password.
Selecting MD5 is required for this manual method, because WordPress stores hashed passwords. The Logging In handbook states that WordPress automatically replaces the temporary MD5 hash with a stronger hash after your next successful login.
WordPress 6.8 hashes new passwords with bcrypt by default instead of the older phpass method, as of November 2026. That change is noted in the wp_hash_password reference.
How do you reset your password with WP-CLI?
Use WP-CLI when you have shell access and email reset does not work, because it avoids direct database edits.
WP-CLI is the recommended approach when standard recovery is not available, according to the Logging In handbook. Run the commands from your WordPress install folder.
- Run
wp user listto find the ID or username of the account. - Run
wp user update USERNAME --prompt=user_passand type the new password when asked. - Log in at
wp-login.phpwith the new password.
The --prompt=user_pass flag prompts for the password instead of putting it in shell history. That detail matters, because a password typed in a command can stay in history, logs, or screenshots.
You can also generate a random password with wp user reset-password USERNAME --show-password, as shown in the wp user reset-password reference. Use that flag with care, because it prints the new password in plain text.
How do you disable plugins when you cannot log in?
Rename the plugin folder over FTP or your host file manager, because that deactivates the plugin without dashboard access.
This fix helps when a plugin update, a login-URL plugin, or a security plugin stops the login page from working. Do one plugin at a time if you know which one changed last, or disable all of them if you do not.
- Connect by FTP, SFTP, or your host file manager.
- Open
wp-content/plugins/. - Rename the suspect plugin folder, for example
wordfencetowordfence-old. - Try to log in at
wp-login.php. - Rename the folder back only after you have fixed the setting that caused the block.
The WordPress.org FAQ Troubleshooting page gives a second method for all plugins: rename the whole plugins folder to plugins.hold, log in, then rename it back to plugins.
After you regain access, go to Plugins, then Installed Plugins, and reactivate plugins one at a time. Test the login after each one, so you can find the plugin that caused the problem.
How do you clear a security plugin block?
Use the email link on the block page first, then disable the plugin by FTP if that link does not work.
Wordfence shows “You are temporarily locked out” when an IP is blocked after a login attempt breaks a brute-force rule. That can follow an invalid username or too many attempts, and the block lasts for the period set in the site's Brute Force Protection options, according to the Wordfence blocking guide.
- On the block page, use the email option to send a recovery link to the admin address.
- Open that email and follow the link.
- If no email arrives, try logging in from another network, such as mobile data, to test whether only your IP is blocked.
- If you still cannot get in, rename the
wp-content/plugins/wordfencefolder over FTP or file manager. - Log in, fix the setting, and only then rename the folder back.
Wordfence also blocks logins when the password is on a list of passwords leaked in data breaches. In that case, reset the password to a new, strong one. You can check an email address against known leaks at Have I Been Pwned.
For setup help after you are back in, see the guide on how to set up the Wordfence firewall. Do not leave the firewall off for long, because the site loses that protection while it is disabled.
How do you fix a broken .htaccess file that blocks wp-admin?
Rename the .htaccess file and test the login, because a bad rule in that file can block wp-admin before WordPress loads.
The .htaccess file sits in your site root on Apache hosts. Security plugins and hosts add rules to it, and a wrong rule can return a 403 error or a redirect loop on the login page.
- Connect by FTP or file manager and find
.htaccessin the site root. - Download a copy, then rename the file to
.htaccess-backup. - Try to log in at
wp-login.php. - If login works, the file was the cause, so rebuild it from a clean WordPress block.
- If login still fails, rename the backup file back to
.htaccessand try the next fix.
WordPress writes its own block between # BEGIN WordPress and # END WordPress in that file. Put your own rules outside those lines, because WordPress can rewrite the block between them.
A 403 error can also come from a host or firewall block rather than .htaccess. The guide on how to fix the 403 Forbidden error covers the other causes to check.
How do you use Recovery Mode after a fatal error?
Open the Recovery Mode link in the email WordPress sends to the site admin address after a plugin or theme causes a fatal error.
WordPress 5.2 introduced Recovery Mode, which shows "The site is experiencing technical difficulties. Please check your site admin email inbox for instructions." instead of a white screen when a plugin causes a fatal error, as the wp-config handbook notes.
- Check the site admin email inbox for the Recovery Mode message.
- Click the link in that email to enter Recovery Mode.
- Go to Plugins, then Installed Plugins, and deactivate the plugin named in the error.
- Click Exit Recovery Mode, then log in as normal.
If no Recovery Mode email arrives, disable plugins by FTP using the steps above. A fatal error on the login page is often a 500 error, and the guide on how to fix the 500 Internal Server Error covers the next checks.
How do you check that you are back in?
Log in at wp-login.php and open the dashboard, because a successful login is the only proof that the fix worked.
- Log in with the new password and open the dashboard home page.
- Open Users, then Profile, and set a strong password you have not used elsewhere.
- Check that your admin email address is one you can still open.
- Re-enable the security plugin and test a fresh login in a private window.
- Clear the site cache if the login page still shows an old block page.
WordPress cookies last 2 days by default, or 14 days when “Remember Me” is checked, according to the Logging In handbook. If the login form reloads after a fix, clear cookies for the site and try a private window.
WordPress.org also notes that the username and password fields are case-sensitive, in its login troubleshooting page. Retype both fields by hand instead of relying on an autofilled value.
When should you contact your host?
Contact your host when you have no FTP, database, or shell access, or when every fix above still fails.
Your host can reset a password, rename a plugin folder, restore a backup, or check server logs for the block. Give them the exact error message, the time it happened, and the fixes you already tried.
Ask the host to check mail delivery if reset emails never arrive, because WordPress cannot send a reset link when the server mail setup is broken. The host can also confirm whether a server firewall, rather than a plugin, is blocking your IP.
If the site is on WordPress.com rather than a self-hosted install, use that platform's account recovery instead. These steps are for self-hosted WordPress sites, as the DreamHost locked-out guide notes.
What mistakes should you avoid?
Do not leave a password reset script or a changed functions.php file on the server after you regain access.
- Do not leave
emergency.phpon the server, because anyone who finds it can change the admin password. - Do not leave
wp_set_password()infunctions.php, because it resets the password on every page load until you remove it. - Do not rename a plugin folder back before you fix the setting that blocked you, or the block can return at once.
- Do not use the same weak password again, and do not reuse a password that is on a known breach list.
- Do not edit the database without a backup, and do not edit the wrong user row in
wp_users. - Do not share a new password in a support ticket, chat log, or screenshot.
After you are back in, consider passkeys for a safer login method. The guide on how to log in to WordPress with passkeys explains how they work.
Frequently asked questions
Can I get back into wp-admin if I no longer have access to the admin email?
Yes, if you have hosting access. Reset the password in phpMyAdmin by editing user_pass in wp_users with the MD5 function, or use WP-CLI with wp user update and the prompt flag. If you have neither hosting nor shell access, ask your host to reset the password or restore access for you.
How long does a WordPress lockout last?
It depends on the cause. A security plugin block lasts for the period set in that plugin, which the site owner controls, so it can be minutes or much longer. A wrong password has no time limit, and it stays wrong until you reset it. A fatal error block lasts until the faulty plugin is disabled.
Will renaming the plugins folder delete my plugins or their settings?
No. Renaming a plugin folder only deactivates that plugin, and renaming the whole plugins folder deactivates all of them. WordPress keeps the plugin files and most settings in place. After you log in, rename the folders back and reactivate the plugins one at a time from the Plugins screen.
Why does the login page keep sending me back to the login form?
That usually points to cookies or site URL settings, not a wrong password. Clear cookies and cache for the site, try a private window, and check that WP_HOME and WP_SITEURL match the address you use. A caching plugin or a security plugin can also cause the loop, so test with plugins disabled.
Is it safe to use the MD5 option in phpMyAdmin to reset a password?
It is safe as a one-time reset step when you follow the official method. WordPress accepts the MD5 value for that login and then replaces it with a stronger hash, and WordPress 6.8 uses bcrypt for new passwords. Change the password again in your profile after you log in, and keep the new password private.
What should I do if I am locked out and the site shows a critical error?
Check the site admin email for a Recovery Mode link and use it to deactivate the faulty plugin. If no email arrives, disable plugins by renaming their folders over FTP, starting with the plugin you updated last. Once you can log in, check the error, update or replace the faulty plugin, and test again.
Sources
- Logging In Developer.WordPress.org
- Reset your password WordPress.org
- Blocking Troubleshooting Wordfence
- Troubleshoot login issues WordPress.org
- Locked Out of WordPress? Here's How to Fix It DreamHost
- FAQ Troubleshooting WordPress.org
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
