Table of Contents
Why You Might Get Locked Out of WordPress
Getting locked out of your WordPress admin dashboard can feel frustrating and scary — especially when you have no idea what went wrong. Thankfully, there are several ways to recover a locked WordPress admin account, even without access to the dashboard. If this method didn’t work for you, don’t stress — I can unlock your admin account safely.
👉 Emergency WordPress Support — Instant Fix
This article will guide you through proven, safe methods to restore admin access, whether you’re a beginner or a seasoned WordPress user.
Common Scenarios That Lock You Out
Understanding the reason helps you choose the best recovery method. Common causes include:
-
Incorrect password or username
-
Forgotten admin email
-
Plugin or theme conflicts
-
Hacked or compromised site
-
Changed user role accidentally
-
Disabled user account
-
White screen of death (WSOD)
-
Corrupted .htaccess or wp-config.php file
Before You Begin: Backup Your Site
Important: Before making any changes, always backup your WordPress site using your hosting panel or a backup plugin. If you’re unsure how to back up your website properly, check out our step-by-step guide on how to restore WordPress site from backup manually to ensure you can recover your site safely.
Method 1: Recover WordPress Admin via phpMyAdmin (cPanel)
If you have access to cPanel or phpMyAdmin, you can easily reset the admin password directly in the database.
Steps to Reset WordPress Admin via phpMyAdmin:
-
Login to your cPanel.
-
Open phpMyAdmin under “Databases”.
-
Select your WordPress database.
-
Click on the table
wp_users. -
Find your admin username and click Edit.
-
In the
user_passfield, selectMD5in the Function column. -
Replace the value with your new password.
-
Click Go to save changes.
-
Log in with the new password.
Pro Tip: After login, consider changing your password again through the dashboard, as MD5 is not the most secure hashing method.
Method 2: Create a New Admin Account via FTP
If your original admin account was deleted or corrupted, you can create a new one manually using FTP.
Steps to Add Admin via FTP:
-
Connect to your site using FileZilla or another FTP client.
-
Navigate to:
/wp-content/themes/YOUR_THEME/functions.php -
Add the following code at the bottom of
functions.php:
-
Save the file and go to your site.
-
Log in using the new credentials.
-
Remove the code immediately from
functions.phpafter login to avoid security risks.
Method 3: Reset Admin Password via Functions.php
If you don’t want to create a new account, just reset the password using the theme’s functions.php.
Steps:
-
Connect via FTP or file manager.
-
Edit
/wp-content/themes/YOUR_THEME/functions.php -
Add this snippet:
-
Save and refresh the home page.
-
Log in and remove the code afterward.
Method 4: Using WP-CLI to Restore Admin Access
For advanced users or developers with SSH access, WP-CLI is the fastest method.
Steps to Reset Password with WP-CLI:
-
Connect to your server via SSH.
-
Run the following commands:
-
Find your admin ID or username, then:
-
Log in with the new password.
Bonus: You can also create a new user:
Method 5: Contact Hosting Provider Support
If nothing works, contact your hosting provider. Most reputable hosts offer 24/7 support and can help:
-
Restore backups
-
Reset credentials
-
Fix corrupted files
-
Check for malware
How to Prevent Getting Locked Out Again
To ensure this doesn’t happen in the future:
Use a Security Plugin
-
Install plugins like Wordfence or iThemes Security to monitor access attempts and limit logins. For a full list of reliable options, check out our guide on the best WordPress security plugins to protect your site from hacks, malware, and unauthorized logins.
Enable Two-Factor Authentication (2FA)
-
Add 2FA via plugins to make login more secure.
Keep a Backup Plugin Active
-
Use UpdraftPlus, Jetpack, or BlogVault to automate backups.
Keep Your Email & Admin Details Updated
-
Ensure your admin email is accessible and updated.
Final Thoughts
Getting locked out of WordPress isn’t the end of the world. Whether it’s due to a forgotten password, plugin issue, or hacker attack, you now know exactly how to recover a locked WordPress admin account using various methods.
At WPThrill, we aim to make WordPress easier for everyone. If you found this guide useful, share it and check out our other tutorials to level up your WordPress skills.
Need Help?
Still stuck? Contact our support team or drop a comment below. We’re happy to help you get back in.