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.
[anphira_blog_cta]
WARNING:
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.
[anphira_blog_cta]
Thanks a lot, It worked perfectly.
It works 100%. Thanks
It works! thank you
woooooooooooooooow thanks you!
wow …!!! thats amazing it worked .Thank you so much
Thank You Very much, this came through for me.
Thanks a lot, good work ……saved my time
Thank you so much!
Thank you very much, it worked.
your work is perfect, thanks
worked perfectly
thank you
worked!! Many thanks!!
Many thanks, worked great for me to manually change my password
It worked. Thank you so much
Nice post! This is massively helpful. It saved a lot of time. Good job and well explained.
Thanks
Thanks a lot, It worked perfectly.
Thanks Gen.
Didn’t have access to phpmyadmin used MySQL workbench. Password shown as encrypted or hashed version on database. Logged into other wordpress site using same database, created new user and password, copied database entry from second site password field, pasted that into lost password field on first site database.
New password worked.
Reafirm previous comments. Be very careful, make triple sure you are changing the correct field. Export a complete copy of the database before you make any changes. Check the site is still working after every change and before you proceed to the next.
Hello,
Thanks for posting this – seems to have worked!
Thanks a lot, It worked perfectly.
Thanks worked perfectly for me and saved a lot of headaches.
I tried to reset my password using the instructions above and it didn’t work.
Working with a database requires a lot of precision and is error prone. Any mistake in the process will result in it not working. I’ve seen people edit the wrong database, wrong table, wrong user, forget the MD5, and enter their new password or username incorrectly. If you are having problems, you should contact your hosting company or site administrator to get professional help.
I can not access my wordpress account and I get The email could not be sent. Possible reason: your host may have disabled the mail() function. when I ask them to email me a new password.
Richard, you’ll need to use the steps above to access phpMyAdmin to reset your password. If you can’t do that, you’ll need to contact your hosting company or website maintenance person to have someone there help you.
After you’ve got your password reset and can login, then you’ll need to follow the steps in the fixing WordPress mail tutorial.
If you’re interested in having a web maintenance person to contact when trouble arises, you can check out our offerings.