You know the feeling. You realize that you forgot to save the new admin password for your website and now you can’t get in. Oh, and…fun times…for whatever reason, “send me my password” isn’t resulting in receipt of any dang emails. You’re stuck. Unable to get into your own website. It’s maddening.
Never fear!! So long as you have access to your database through PHPMyAdmin (very often found in your cPanel), there’s a super easy solution.
Step 1 – Identify your database name
Now, if you only have one database in the system, this is a no-brainer. But sometimes there are old, leftover databases still in the system, or you have multiple installs using the same database, and it can be frustrating to figure out which one runs your current site. You can easily look in your wp-config.php file to find out which specific database name you’re looking for. It’s located in the root of your WordPress install.
Step 2 – Locate your database
I’m going to assume that you have cPanel or something very similar with your host. Simply look for this somewhere on the homescreen:
Just click on the item indicated by the arrow.
With any luck, you’ll automatically be taken to your databases. If there are multiple databases in your PHPMyAdmin, this is when you need to know the name of the database you’ll be editing. Click on it in the menu on the left.
Within that database you will see a bunch of tables, often with the prefix wp_. You may have changed this prefix in your install or as part of security settings though. For example it could be xyz_. Whatever. It should be pretty obvious when you’re in the right area.
Find the table titled wp_users (or whatever your prefix is + “users”). Just click on that table name in the main part of your screen.
Step 3 – Edit your password
You, as admin, likely are the first user entry in this table. You’ll see a display like this:
Click on the indicated icon (the pencil) to edit this user.
This is what will appear:
Notice that the password is all encrypted and weird looking. There’s no way you can look at that string of characters and go “a-HA! THAT’S what my password was! D’OH” Sorry. For security, WordPress encrypts passwords as an MD5 Hash.
Now, there are 2 ways you can finish this up.
Step 3a – Method one for changing your password directly in the database
You can select that encrypted string and delete it, then type in your regular-old password that you want to use now. But before you click “Go” (in order to save the change), you’ll need to expand the drop box to the left of the password field and select “MD5”. Once you’ve done that, then you can click on Go and you’re done.
Personally, I prefer the following method. Not sure why, it’s just a personal preference:
Step 3b – Method two for changing your password directly in the database
You know, honestly, the version I prefer is more steps than the other way. But I gotta admit that I really enjoy seeing that crazy string of text appear, knowing that it translates to whatever I’d just typed above. But I’m weird. I know this 🙂
If you found this useful, or have any questions, please leave me a comment here! I’m always happy to help!