If you’ve ever been locked out of a WordPress site because the password was lost or changed or somehow corrupted, no need to worry. There’s an easy way to reset it in the database.
Since most people these days work with a web host that uses Cpanel, we’ll use Cpanel in this tutorial. If you don’t have Cpanel, then simply find your way into your database using the method recommended by your host.
Log in to Cpanel and Access phpMyAdmin
You should be able to log in to your Cpanel by simply typing cpanel at the end of your domain name in your browser. For example:
This should automatically redirect you to the URL http://mysite.com:2082. Simply remembering to put "cpanel" at the end of your domain is much easier, however.
Once you’re logged in, find the phpMyAdmin icon and click on that.
Find Your Database
If you only have one database, you can skip this section and go to the next section.
If you have more than one database, then you will need to find out which one applies to the site you’re working with.
In order to do that, go back out to your Cpanel homepage and look for the File Manager icon and click on that.
You will probably get a popup that gives you a few different options.
The default is probably fine here. You’ll just want to make sure you’re going to your Web Root (public_html/www).
So when that’s set, click Go.
Once inside your file manager, you’ll see a list of your WordPress files. Find the file called wp_config.php.
Select the wp_config.php file, and then click on the View button at the top.
Once inside this file, you should be able to find the name of your database near the top of the page.
In this case, the database is named mysite_wrdp1.
Find User and Reset Password
Once you’re inside your database area, find the wp_users link and click on that.
Find the name of the user you want to change the password for, and click on Edit.
Fill in your new password in the user_pass box on the right, and then on the left use the pulldown menu to select MD5. Using MD5 will encrypt your password.
Then hit the “Go” button at the bottom.
After hitting the “Go” button, you should be redirected back to where you started, and you should see your new password encrypted.
That’s it. You should be able to log in with your new password now.