How to reset your wordpress Password.
If you can’t remember your WordPress password, you’ll need to reset it. This article covers how to reset your WordPress password when using cPanel.
This guide covers how to reset the WordPress login password by manually editing the site’s database, so the first thing we need to do is check which database it is that your WordPress site is using. You’d do this by checking the wp-config.php file that your WordPress site uses.
Check Which Database is in use.
Firstly, you’ll need to check which database your WordPress site is using, so that you know which database to use to reset the password.
To do this, log in to your cPanel then access the file manager, like this:
No browse to the public_html directory (or the document root of your site’s domain if you’re using multisite hosting):
Locate the wp-config.php file, then right click on it, and select “edit”, like this:
Now locate the line that starts with:
define( ‘DB_NAME’,
Just after DB_NAME you’ll see the name of the database the site uses.
Make a note of the database name just after DB_NAME.
Now you know which database it is that you’ll need to edit to change the password.
Changing the Password via the database.
Now you know which database it is that you’ll need to edit to change the password, you’ll need to access and edit the database to make the password change.
If you still have the file manager open, close it and you should be back at the main cPanel page. Now we need to access PHPMyAdmin as this can be used to manually edit the database. So type PHPMyAdmin in the “Search tools” box at the top, then click on the PHPMyAdmin icon, like this:
You’ll now be redirected to PHPMyAdmin. Which looks like this:
In PHPMyadmin, click the + next to your cPanel username, like this:
Then click on + next to the name of the database that you obtained from the wp-config.php file:
This will now show the tables in the database your WordPress site uses. Locate the table ending in _users and then click on it:
And you’ll now see the contents of the users table, click on “edit” on the same line as your WordPress username. If you’ve forgotten your Wordpess username, locate the user with 1 in the ID column, make a note of what’s in the user_login column (this is your WordPress username), then click “edit” on the same line as the user with 1 in the ID column:
This next part is important.
WordPress encrypts usernames using MD5 by default, so on the same line as “user_pass” click on the drop down box just to the right of “user_pass”:
And a really big list will appear, from this list you need to select MD5, like this:
Now delete the text in the big right box to the right of user_pass, like this:
In the same box (the one you just deleted from), type what you’d like to be your new Wordpres password (I’m setting this_is_my_new_password as my new password in the example, but make sure you don’t do this! Type a strong password instead of this_is_my_new_password):
The click the “Go” button in the bottom right hand corner of the screen to commit the new password.
Congratulations, you’ve now changed the password for your WordPress.
You’ll now be able to log in to WordPress by browsing to https://www.mysite.com/wp-admin (unless you’ve changed the login page address) and entering your WordPress username the password you’ve just set. You’ll need to change the mysite.com part to your actual site address. There’s also a brief guide covering how to log in to Wordpres here.
As WordPress always stores user login details in the site’s database, the method is roughly the same even if you’re not using cPanel or PHPMyAdmin.
Generally speaking this approximate outline will always work:
- Check which database it is that the site uses.
- Open and browse the database, then locate the users table (this will always end in the word users)
- Edit the line containing your WordPress username
- Select MD5 in the drop down next to user_pass
- In the editable field on the same line as user_pass enter what you want to be your new WordPress password
- Commit/save the change
- Log in to your WordPress using the new password and the user for which you reset the password.
There is always WordPress’ own password reset mechanism that can be used to reset a WordPress password, but this relies on your WordPress being able to send emails and you to receive emails for the email address set against your WordPress user.
The method I’ve detailed above resets the password “under the hood”, without emails being involved. You just need to be able to log in to your cPanel where your Worpdress is held to be able to use the guide above.