Knowledgebase

Resetting a WordPress Password in the Database Print

  • databasesphpmyadmin, databases, password, wordpress, database, troubleshooting, email, phpmyadmin
  • 0

Regaining access when locked out.

WHEN YOU NEED IT

The password reset email does not arrive, usually because mail is not configured You have lost access entirely

THE METHOD

  1. phpMyAdmin, browse the wp_users table.
  2. Find your user row and click Edit.
  3. In the user_pass field, choose MD5 from the function dropdown.
  4. Type the new password in plain text in the value field.
  5. Go.

WordPress accepts an MD5 hash on login and immediately re-hashes it properly.

THE BETTER METHOD

WP-CLI, if you have SSH access. One command, handled correctly.

CREATING A NEW ADMINISTRATOR

If your account is damaged rather than just inaccessible, creating a new administrator is sometimes easier.

That requires rows in both wp_users and wp_usermeta, with the capabilities key carrying the correct table prefix.

Getting the prefix wrong is why this frequently appears to work and does not.

AFTERWARDS

Log in, change the password properly through the interface, and fix whatever prevented the reset email arriving.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot