When you’re locked out of WordPress and the “lost password” email never shows up (often because the site can’t send mail), you can reset the password directly in the database. It sounds intimidating but it’s a five-minute job in phpMyAdmin.

Open phpMyAdmin

Log in to cPanel and open phpMyAdmin under the Databases section. On the left, select your site’s database. If you’re not sure which one it is, check the DB_NAME line in wp-config.php.

Find the users table

Click the wp_users table (the prefix may differ — it could be wp_ or something custom). You’ll see a list of user accounts. Find your admin account and click Edit on that row.

Set the new password

Locate the user_pass field. It currently holds a long hashed string. In the Function dropdown next to it, choose MD5. Then, in the Value box, type your new plain-text password. WordPress accepts MD5 hashes and upgrades them to its stronger format on your next login.

Save the change

Click Go at the bottom. That’s it — the password is changed. Head to yourdomain.com/wp-admin and log in with the new password.

Fix the underlying email problem

If you’re resetting passwords this way because the reset email never arrives, the real issue is that WordPress can’t send mail. Install an SMTP plugin and route mail through an authenticated mailbox so future resets work normally. It’s worth fixing — losing access to password recovery is a risk.

A quicker alternative

Some hosts, including ours, offer WordPress management tools in cPanel that let you reset the admin password with a couple of clicks and no database editing. Check the WordPress Manager or Softaculous section — if it’s there, it’s the faster route.

Once you’re back in, change the password again from within WordPress to a strong, unique one, and consider enabling two-factor authentication so you’re never locked out the same way twice.

Was this article helpful to you?

admin

Leave a Reply

You must be logged in to post a comment.