How to Reset Your WordPress Password

Share this post

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.

how to reset your wordpress password

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:

How to reset your WordPress password

No browse to the public_html directory (or the document root of your site’s domain if you’re using multisite hosting):

open public_html

Locate the wp-config.php file, then right click on it, and select “edit”, like this:

Edit wp-config.php to see database name

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.

make a note of the database 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:

Access PHPMyAdmin

You’ll now be redirected to PHPMyAdmin. Which looks like this:

PHPMyAdmin interface

In PHPMyadmin, click the + next to your cPanel username, like this:

expand cPanel user dbs

Then click on + next to the name of the database that you obtained from the wp-config.php file:

expand database phpmhyadmin

This will now show the tables in the database your WordPress site uses. Locate the table ending in _users and then click on it:

View users table in PHPMyAdmin

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:

Edit wordpress user in database phpmyadmin cpanel

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”:

Select MD5 in drop down

And a really big list will appear, from this list you need to select MD5, like this:

select md5 phpmyadmin cpanel

Now delete the text in the big right box to the right of user_pass, like this:

Delete existing password

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):

Enter new password for wp-admin user

The click the “Go” button in the bottom right hand corner of the screen to commit the new password.

Commit password change

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.

wordpress login page

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:

  1. Check which database it is that the site uses.
  2. Open and browse the database, then locate the users table (this will always end in the word users)
  3. Edit the line containing your WordPress username
  4. Select MD5 in the drop down next to user_pass
  5. In the editable field on the same line as user_pass enter what you want to be your new WordPress password
  6. Commit/save the change
  7. 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.

how to reset your wordpress password

Share this post

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top