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 following methods are more technically involved and not recommended if you're not completely sure of what you're doing. Changing things in the database directly can break your site. Please ensure you know what you are doing and have backups of the site 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 file:

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

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

You'll then see a list of the tables, your database may contain more tables than this. Your are looking for the table ending _users

Click on this _users table and you'll see a list of the user accounts.

Click Edit next to the account whose password you'd like to reset.

In the resulting window you'll be working on the user_pass row. Select MD5 from the drop-down in the Function column and then delete any text currently in the Value column and enter your desired password here. Finally 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.


How did we do?


Powered by HelpDocs
© Krystal Hosting Ltd 2003–2019