Back to knowledgebase

Change a WordPress User Password in the Database

If you cannot reset a WordPress password by email and cannot access the WordPress dashboard, you can change the password directly in the database.

This should only be used as a recovery method. Editing the database incorrectly can break the site, so take a database backup first.

  1. Open phpMyAdmin from your hosting control panel.
  2. Select the database used by your WordPress site.
  3. Open the table ending in _users.
  4. Find the user account you want to update.
  5. Select Edit for that user.
  6. Find the user_pass field.
  7. Delete the existing value.
  8. Enter the new password in plain text.
  9. In the Function column for user_pass, choose MD5.
  10. Save the change.

You should now be able to log in to WordPress with the new password.

WordPress does not store passwords as plain text. The MD5 option is used here as a recovery method. After you log in, WordPress should update the stored password hash to its normal format.

The database table prefix may not be wp_. If your site uses a custom table prefix, look for the table that ends in _users.

After logging in, go to your WordPress profile and set a strong new password. If the password was changed because of a security issue, review the site’s administrator users as well.