How to reset your Wordpress password

This guide details three ways to reset the password for a WordPress user account.

The first should be used when you know the username or email address of the user account you are trying to reset. This is the easiest and preferred method.

The further methods are more technically involved and not recommended if you're not completely sure of what you're doing. Changing things in the WordPress database directly can break your site. Please ensure you know what you are doing and have backups of the site, including the database in case something goes wrong.

The second method involves changing the account's password within the MySQL database associated with the site and the third method is using WP-CLI via SSH to reset a users password.

In order to use this method you need to know the username or an email account associated with the account for which you wish to reset the password.

Visit the sites wp-admin page e.g. www.mysite.co.uk/wp-admin

Click the Lost your password? link

Enter the username or email address of the user and click the Get New Password button.

If you enter a username - the email will be sent to the email address associated with that username - so you should have access to that mailbox.

The email you receive will contain a link to reset your password - click the link

WordPress will automatically suggest a new strong password - feel free to change it, but take note of any password requirements specified.

Once you've made a note of the password, click the Reset Password button. You should now be able to login with that username/email address and password.

The following methods require access to cPanel or SSH shell access for the hosting account - they should only be attempted if you know what you are doing and are sure you have a backup of the full site & database in case anything goes wrong.

Resetting an account password in the database

You'll need to access the cPanel for the account where the WordPress site is hosted.

You will also need to know the name of the database associated with the site. You can find this within the site's wp-config.php file:

Once you are logged in to cPanel you'll need to access phpMyAdmin from the Databases section by clicking the phpMyAdmin icon.

  1. Within phpMyAdmin click on the name of the WordPress database you established at the beginning in the left hand column.

  1. You'll then see a list of the tables. (Your database may contain more tables than shown in this image.) All of the tables will have a prefix and these will be different. In the image above, the prefix is "WP". You are looking for a table ending in _users. Click on the _users table and you will see a list of the user accounts.

  1. Click "Edit" beside the account whose password you would like to reset.
  1. In the resulting window, you will be looking for the user_pass row.
  1. Select the drop down in the function column and then choose "MD5".

  1. Under the "Value" column, remove any text that is already present and enter your desired password.
  2. Click the "Go" button.

You should see a green success message. You can now use the password you entered to login for this user.

You can also see the username and email address on this screen in the user_login and user_email values respectively. They can also be changed at the same time as the password, or later if required - simply enter the required changes in the Value column. Do not select a Function for these values.

Use WP-CLI to add a user or reset a password

You'll need shell access to the account containing the WordPress install. We have articles on accessing SSH on your server for both Windows and Mac clients.

SSH access is available on all Krystal plans apart from Amethyst.

Using your chosen terminal application connect to your hosting server, either with it's home server name, your domain name, or the server's IP address.

Once you've gained access, navigate to the directory containing your WordPress install - often this will be public_html

You can now use WP-CLI commands to make changes to your WordPress install.

To list the current user accounts:

wp cli user list

Once you've established the username you can reset it's password with:

wp cli user update username --user_pass=<new password>

Where username is the user whose password you'd like to change, and <new password> if the password you'd like to set.

WordPress.org has a full online command reference for WP CLI (external link opens in a new window).


How did we do?


Powered by HelpDocs (opens in a new tab)
© Krystal Hosting Ltd 2002–