Security and SSL

Ways to recover or change a WordPress user's password

Reviewed on 5 min read WordPress passwords login

If you cannot log in to the WordPress dashboard (wp-admin) because you have forgotten the password, there is no way to recover the old one: WordPress stores it encrypted. What you can do is change it to a new one and log in straight away.

The WordPress password is separate from the cPanel and client area passwords: changing those does not change the WordPress one.

These are the methods, from the simplest to the most technical.

With "Lost your password?"

This is WordPress's own method. The link is below the login form and is sometimes easy to miss. Click it, enter your username or email address and you will receive a link to choose a new password. If it does not arrive, check your spam folder.

The "Lost your password?" link on the WordPress login page

It does not work if you do not remember the username, if the administrator's email address no longer exists or if the site cannot send emails. In those cases, use any of the following methods.

With Softaculous

  1. Log in to cPanel and open Softaculous Apps Installer.

  2. At the top, click the WordPress icon to see the list of installations.

    If your site does not appear in the list, click Scan in that same section and Softaculous will add it.

  3. Next to the installation, click Manage users (the user icon).

    Manage users option next to the WordPress installation in Softaculous

  4. Choose the user from the drop-down, enter the new password in Password and click Save.

    Form for changing a WordPress user's password in Softaculous

You can now log in with that user and the new password.

With WordPress Toolkit

  1. Log in to cPanel and open WordPress Toolkit.

  2. Click your installation to expand its options.

    If it does not appear, click Scan and WordPress Toolkit will find it and add it.

  3. Click Setup, below the site's thumbnail.

  4. Choose the user, enter the new password (and, if you like, change their email address) and save.

Changing a user's password from WordPress Toolkit

With WP-CLI

If you have SSH access, go to the installation's folder and list the users to see the exact name:

wp user list --fields=ID,user_login,user_email,roles

Then change the password. Replace USUARIO with the username or ID:

wp user update USUARIO --prompt=user_pass

WP-CLI will ask you for the new password without it being saved in the command history.

With phpMyAdmin

  1. Find the database name and the table prefix in the installation's wp-config.php file:

    define('DB_NAME', 'nombre_base_de_datos');
    $table_prefix = 'wp_';
    
  2. Log in to cPanel, open phpMyAdmin and select that database.

  3. Open the wp_users table (with your prefix in front of users).

  4. Click Edit on the user's row.

  5. In the user_pass field, delete what is there and type the new password. In the Function drop-down for that row, choose MD5. This is essential: without MD5 the password will not work.

  6. Click Go.

If you prefer, you can do it with a query in the SQL tab (change the prefix, the password and the username):

UPDATE wp_users
SET user_pass = MD5('NuevaContraseña')
WHERE user_login = 'USUARIO';

MD5 is an old, weak hash, but WordPress accepts it and, the first time you log in, automatically replaces it with its current hashing. So, as soon as you log in, change the password from Users > Profile to a permanent one.

If you still cannot log in

  • Check that you are using the correct address: some security plugins replace wp-admin with a different URL.
  • A security plugin, an IP restriction or two-step verification can block access even if the password is correct. If you suspect a plugin, rename its folder in wp-content/plugins from the cPanel File Manager to deactivate it.
  • If the user list shows administrators you do not recognise or the administrator's email address is not yours, your site may have been hacked. Follow what to do if your site has been hacked.

You may also find useful

Something wrong or out of date? Tell us and we will review it.