You’ve lost your WordPress password and can’t log into your site. And what’s worse, the reset password feature isn’t working (either because it can’t send mail or something else is wrong). This tutorial covers how to regain access to your site by direct database manipulation with phpMyAdmin.
Tired of dealing with WordPress challenges on your own?Click here to get back hours of your life each month with Worry-Free Maintenance
Direct database manipulation could crash your entire site. Use of these directions is at your own risk.
Step 1: Access phpMyAdmin
First you need to login to your hosting account (if you are having difficulty with that, you HAVE to contact your hosting company). The most common type of hosting account admin area is cPanel, so this tutorial uses screen captures from cPanel. (Btw: If your hosting company is being a real pain, I recommend you look at other options)
Once you have logged into your hosting backend, you need to access your wp-config.php file. In it you need to look for DB_NAME, DB_USER, and DB_PASSWORD. These three items will be needed for the next steps. I have obscured the actual values for these, use the values in your own file. Remember to use the value between the ”, do not use the ”.
Now that you have your database information, look on your cPanel for something called phpMyAdmin. Click on that and it will open in a new window. Note: it can take a minute for you to be redirected to phpMyAdmin, this is normal.
Usually at this point you will need to login to phpMyAdmin. Use the DB_USER value for the username and DB_PASSWORD value for the password. After clicking on login, you may have to wait another minute for the redirection before you see the main area.
Step 2: Change Your Password
Look for a database which has the same name as DB_NAME. You need to view the tables for this database. Once you’ve found your database, select the wp_users (it may have a different prefix than wp_) table and click on Browse.
You should see a table with one entry per user on your WordPress site. Click on Edit in the entry that you want to change the password for.
Look for the line that starts with user_pass. Delete the text in the right text box and replace it with the new password that you want to use. I have put in temp1234, but you should use a strong password. After entering your new password, use the drop-down menu to select MD5.
Then scroll down to the bottom and make sure that Save is selected and then click on Go. This will save your password change.
Step 3: Login to WordPress
Now go to your WordPress login URL and enter your username with the password that you just set up.
Step 4: If Your Email Function Was Broken, Fix It
If you couldn’t reset your password for WordPress using the standard “Forgot Password” option and the error message said:
The e-mail could not be sent. Possible reason: your host may have disabled the mail() function.
Then you’ll need to fix your WordPress Emailing as well. Click here for the tutorial on that.
Step 5: Leave a Comment Below
Let me know if this worked for you. It is technical, so go slowly, be careful, and remember in usernames & passwords, every character counts. So if it’s a uppercase R, make sure than uppercase R is entered and not a lowercase r.
Disclaimer: As warned at the beginning, use this tutorial at your own risk, we are not responsible for any damage that could happen to your site. Direct database manipulation of the wrong thing can take down your whole website, so if you aren’t sure get some help.