Forgetting your password for your WordPress website can be a worrying time, but whilst it's inconvenient and frustrating, all is not lost. Today we're going to show you 3 different ways to change your password when you've forgotten it.
The simplest way to reset a lost WordPress password is to use the built-in form provided by WordPress.
To do this, simply go to your WordPress login link and then click on Lost your password?
You'll then be taken to a screen which prompts you to enter your username, or your email address associated with your WordPress account in order to reset your password.
Once you've entered your username or email address, click on the Get New Password button and your WordPress website will email you a link to reset your password, which will then allow you to log in.
But we understand it's not always that easy - you may have forgotten what email address is linked to your account, or no longer have access to the email account, or perhaps your WordPress website just isn't sending out the password reset email - all is not lost!
The second option we have today is to change the password via phpMyAdmin - alternatively, you may prefer to update your email address via phpMyAdmin and then follow option 1 above, if you don't have access to your email address any more. We'll show you how to change both your password, and email address for your WordPress website using phpMyAdmin.
Firstly, you need to access phpMyAdmin - how you do this will vary from host to host, but if you've got access to a hosting control panel such as cPanel, just search for phpMyAdmin and click on it.
In most cases, this will take you straight to the main phpMyAdmin front page, you should see a list of databases on the left hand side - select the one for your website (if you're unsure on which database you need to access, take a look at your wp-config.php file, this will show the database being used).
Go ahead and click on the [+] symbol beside your database, you will then see a list of database "tables" - WordPress websites can have many different table names and prefixes, you need to locate the tabled that ends with the word users, for example, wp_users - in our example image, the table is named wpbk_users. Go ahead and click on your user table.
You should now see a screen with a list of users (if you have multiple users, or just your own account if you're the only member) on your website, we'll only be modifying a single user, your account, so locate it in the list.
As you'll see, we have several columns:
For the purposes of this guide, we'll be looking specifically at 2 of the above - user_email and user_pass. If you'd like to change your email address to follow option 1 above, simply double click on the existing email address and it will open up an edit box for you
Once you've changed it, click anywhere outside of the edit box and it will save your new setting - you can now follow option 1 above if you wish.
However - we're now going to go ahead and change the password directly in phpMyAdmin.
As mentioned already, the password is hashed by WordPress so that it can't be read by a user or hacker, and for that reason, any new password we set will also need to be hashed. The simplest way to do this, is to md5 encrypt our new password before we paste it in, WordPress will then rehash it using it's hash keys.
To create a new md5 password, use a website such as https://www.md5hashgenerator.com/ on the website, enter a password you wish to use in the box provided, and then click on Generate - you will then be given a hash as well as your original string
Make sure you remember "Your String" and then copy "Your Hash" to your clipboard, then go back to phpMyAdmin and double click on the existing password hash in the user_pass field
Paste your new hash into the field, then click outside of the edit box to save - you should now see your new password hash saved.
Now go ahead and log in to your WordPress website with your new password, and update any credentials you need to.
WordPress Command Line Interface (WP-CLI) is a very useful tool if you have access to SSH on your webhost, for the purposes of this guide, we're going to assume that you have SSH access and WP-CLI is already installed on the server.
The first thing we need to do is get our user ID, we can do this by running the user list command
# wp user list
This should show us a full list of users, as well as the user IDs, make a note of the ID for your user and we'll then change the password using the following command
# wp user update <user id> --user_pass=YourNewPass
Be sure to replace <user id> with your user id, and if you'd also like to change your email at the same time, you can do so - a full example of changing email address and password would be
# wp user update 1 --user_pass=YourNewPass [email protected]
Once done, press enter and you should receive a success message
Success: Updated user 1.
You should now be able to log in to your WordPress website using your new password.