Have you ever been locked out of your WordPress admin dashboard and can’t reset your password the usual way? Don’t worry — if you have access to your website’s database (usually via phpMyAdmin), you can easily retrieve or reset your admin password manually.
In this guide, we’ll show you how to find or reset your WordPress admin password directly from the database using phpMyAdmin. This is especially useful if:
- The password reset email isn’t working
- You’ve lost access to your admin email
- You’re troubleshooting login issues
Let’s dive in.
⚠️ Important: Passwords in WordPress Are Hashed
Before we start, note that WordPress stores passwords in a hashed form using the MD5
algorithm. That means you can’t “see” your actual password — only the encrypted version.
So instead of finding the existing password, the best solution is to reset it manually in the database.
🔧 Method: Reset Admin Password via phpMyAdmin
Follow these steps:
Step 1: Log into phpMyAdmin
Most web hosting control panels (like cPanel or Plesk) give access to phpMyAdmin. Here’s how to access it:
- Go to your hosting dashboard
- Look for “phpMyAdmin” and click it
- Select your WordPress site’s database from the list on the left
Not sure which database belongs to your WordPress site? Check your
wp-config.php
file for the line:define('DB_NAME', 'your_database_name');
Step 2: Find the wp_users
Table
In the list of tables, find the one called wp_users
.
⚠️ Note: Some installations may have a different prefix (e.g.,
xyz_users
instead ofwp_users
).
Click on it to open the user list.
Step 3: Locate Your Admin Account
Look for the row that contains your admin username. It will usually have the role set to administrator
.
Take note of the user_login
and user_email
fields to make sure you’re editing the correct account.
Step 4: Edit the User’s Password
- Click the Edit button (usually a pencil icon) next to your admin row.
- Find the field called
user_pass
. - In the “Function” dropdown next to it, select
MD5
. - In the “Value” field, enter your new password in plain text (e.g.,
MyNewSecurePassword123!
). - Click Go to save the changes.
This will store your new password in an MD5-hashed format. WordPress will rehash it using a stronger algorithm once you log in again.
✅ Success! Log in with Your New Password
Now go back to your WordPress login page (usually yourdomain.com/wp-admin
) and sign in using:
- Username: your admin username
- Password: the new password you just entered
You should now be able to access your WordPress dashboard.
🔐 Security Tip: Update to a Stronger Password
Since MD5 is outdated and less secure, WordPress will automatically upgrade your password hash once you log in. Still, make sure your new password is strong, unique, and secure.
Consider using a password manager like LastPass or 1Password.
🧠 Bonus Tip: Use WP-CLI (Advanced Users)
If you have SSH access to your server, you can also reset your password using WP-CLI:
bashCopyEditwp user update 1 --user_pass="YourNewPassword123!"
Replace 1
with your admin user ID if different.
Final Thoughts
Losing access to your WordPress admin area can be frustrating, but as long as you have database access, you’re never truly locked out. Just follow the steps above to reset your admin password securely.
Need more WordPress tips and tutorials? Check out our WordPress guides here (← insert your internal link).
🎨 Looking for a Clean, Secure WordPress Theme?
If you’re fixing login issues, it’s also a good time to consider a fresh, optimized theme. Check out our WordPress theme collection — built for speed, security, and simplicity.
Whether you’re a blogger, business owner, or developer, we have beautifully designed themes to fit your needs.