Reset a WordPress password with phpMyAdmin
Locked out of wp-admin with no working reset email? Set a new WordPress password directly in the database using phpMyAdmin in cPanel.
If the WordPress reset email never arrives and you cannot get into wp-admin, you can set a new password directly in the site's database. This guide covers finding the right database, editing the user record in phpMyAdmin, and logging back in. You will need your cPanel login and a few minutes; nothing on the site changes apart from that one password.
Try the normal "Lost your password?" link on your login page first. If the email arrives, use it and stop here. The steps below are for when it does not.
Find which database the site uses
A cPanel account can hold several databases, so confirm which one belongs to this site before you edit anything.
- Log in to cPanel and open File Manager.
- Go to the folder holding the site. For a primary domain that is usually
public_html; addon domains and subdomains have their own folders. - Find
wp-config.php, select it, and click Edit (or View if you would rather not risk a change). - Near the top, note the value of
DB_NAME. That is the database you want. The line looks likedefine( 'DB_NAME', 'user_wp123' );. - Close the file without saving.
While you are there, note the value of $table_prefix further down. It is often wp_, but installers sometimes set something else, and you will need it in a moment.
Change the password in phpMyAdmin
- Back in cPanel, open phpMyAdmin under Databases. It opens in a new tab.
- In the left sidebar, click the database name you noted.
- Click the users table. With the default prefix it is
wp_users; with a custom prefix it will be your prefix followed byusers. - Find the row for your account, matching on
user_loginoruser_email, then click Edit on that row. - On the
user_passrow, open the Function dropdown and choose MD5. - Clear the Value box for
user_passand type your new password as plain text. WordPress hashes it, so type the password itself, not a hash. - Click Go at the bottom. phpMyAdmin confirms one row was affected.
Now go to your login page and sign in with the new password. WordPress upgrades the stored hash automatically the first time you log in.
If it didn't work
Check the database first: on a site that has been moved or rebuilt, wp-config.php sometimes points at a database that is no longer the live one, and an old copy is easy to edit by mistake. Check the table prefix next, since editing wp_users when the install actually uses a different prefix changes nothing you will see. And if the login page reloads without an error, clear your browser cookies for the site or try a private window, because a stale session cookie can bounce you straight back.
Still stuck? Open a ticket at /support and tell us the domain and the username you are trying to reset.
More in WordPress
Stuck partway through? Support is answered by the engineers who run the servers, around the clock.