How to reset your WordPress password when you can't get in to admin

Changing your WordPress password is easy enough if you can actually sign in to WP - just go to Users > My Profile, scroll to the bottom and input the new pw twice: job done. But if you can't get into WordPress in the first place, things get a little more complicated.

emailerrorWhat you're supposed to do is go through the password reset routine:

  • from your WP login screen (http://domain.com/wp-login.php), click the "lost your password" link.
  • Input the user name or email associated with your WP id, and
  • you'll be sent an email to reset your password.
  • Click the link in this email, and a new password will be generated, and again sent via email.
  • You can then sign back into WordPress and reset your password to something you'll remember.

But this has a number of potential problems. Firstly, it assumes you remember what the email and/or login associated with that particular WP install is. Personally, I have a lot of WordPress installs, *and* a fair few email addresses, and I can't always match them up: sitting cycling through a dozen email addresses trying to find the right one is just frustrating.

And too often, the pw-reset email doesn't turn up. Or it doesn't turn up for 24 hours or so. I don't know why this is, but I know I'm not the only person with the problem. So I prefer to bypass email altogether and reset the password directly.

Resetting the WordPress password in PHPMyAdmin

If you have access to the database storing your WordPress information, you can reset the password directly yourself.

  • Sign into PHPMyAdmin (if you don't know where that is, you can probably find a link from your hosting's control panel) and find the database that's storing WordPress.
  • Find the table that's storing your "users" data; it's most likely to be wp-users, though the prefix may be something other than wp-. Click "browse" to see the content in this table.
  • Find the line for the user whose pw you want to change (if you're the only user on your blog, you'll only have one line here).
  • Click the pencil icon to edit it.
  • Look at the "user_pass" field. You'll see a longish string of random characters that bears no resemblance to any password you'd ever have picked. This is the encoded version of your current password.
  • Delete it. Add in your new password (just in ordinary non-coded text).
  • From the drop-down menu beside it, select MD5. This will encode your password when you save it.

    md5screenshot

  • Click the "go" button at the bottom of the form to save your new pw.
  • Then go back to wp-login.php and make sure you can sign in.

Alternatively, if I'm hosting your WordPress blog, email/Skype me and I'll change it for you. Just one more advantage of web hosting with a human being ;-)

Share this post:
  • email
  • del.icio.us
  • Facebook
  • FriendFeed
  • LinkedIn
  • StumbleUpon
  • Tumblr
  • Twitter

Tags: ,

Posted by Sue on August 17, 2009 in WordPress.

3 comments to "How to reset your WordPress password when you can't get in to admin"

  1. Zone wrote:

    Thanks for this great info. It really helped me a lot. My site was hacked so I changed the password. And now my site is back to normal. More power to you!

    • Sue (@blogmum) wrote:

      Zone, you may need to do more than just change the password. Have you checked for dodgy files added, iframes added to posts, hidden lists of links in your footers, for example?

  2. MichaelR (@onesuite) wrote:

    This might be useful in the future. Thanks for sharing...bookmarking it...might need it someday.

    Michael.

Leave a Reply