If you’ve got a WordPress site, chances are you’ll get locked out of your admin at some stage whether it be a hacking issue or just plain forgetfulness. First step is to use the ‘forgot password’ function on the WordPress login screen but if you’re hacked or no longer using the email setup in WordPress – General settings then this won’t work.
The way I normally retrieve/reset passwords for myself or clients is to go into the hosting control panel’s phpMyAdmin section and do it manually in the database. Not for the faint-hearted I guess but not that hard when you’re walked through as I’m about to do!
Login to your hosting control panel at something like http://www.yourdomain.com/cpanel and click the phpMyAdmin icon under “Databases” as below:
In phpMyAdmin, choose your WordPress database name top left then click on the “wp_users” table in the resulting table list to bring up a list of user accounts. There will probably be only one user for most people.
Click the “Edit” link on the user you want to change the password for.
On the edit user screen, scroll to the “user_pass” row and type/paste in your new password then select “MD5” from the Function dropdown then “Go” at the bottom to save the new password in the database. This encrypts the new password.
That’s it. You can now go back to the WordPress login screen and enter the new password and you should get in fine.