HowTo: Recover Wordpress Password Part I

31. Mar 2007 · 2827 Views ·

Tips & Tricks, Wordpress



A few days ago, I installed Wordpress on one of my project/experiment blogs and I forgot to write down or change the temporary password. I only realized my mistake right after I signed out. I couldn’t remember the password and I couldn’t log back in. If it can happen to me, someone who has been using Wordpress for several years now, I know it can happen to anyone, especially newbies.

There are times when we inadvertently lose or forget our blog passwords and when this happens, there are several ways to recover your password.

Automatic Remailer

If you can still remember your username and email address, you can use the Wordpress automatic remailer or “lost password” feature found on your blog’s the login page.

  • Go to your Wordpress Login page (http://yoursite.com/wp-login.php)
  • Click on Lost you password?
  • You will be redirected to a different page where you will be asked to enter your user name or email address.
  • Check your email inbox for your new password.
  • Login to your Wordpress blog with your new password.
  • Go to Profile in your Admin panel and change the password to something that you can remember.

The problem with this feature is that it doesn’t work all the time, especially if the internal PHP mail function is disabled by your web host. I’ve had several experiences where I used that option and I never received the email.

If that happens, the next thing you can do is reset your password through the MySQL command line. You can do this by connecting directly to your server via SSH, or by using the MySQL client on your workstation to connect to your server. This is a bit complicated but you’ll be able to do it as long as you follow instructions. This process resets your password.

Through a MySQL command line
(replace all details in bold with your own data)

1. Type “mysql -u root -p” (Logs in to MySQL)
2. Enter your password at the prompt.
3. Type “use name-of-database” (Select your WordPress database)
4. Type “show tables LIKE ‘%users’;” (Finds the WordPress user table)
5. Type “SELECT ID, user_login, user_pass FROM name-of-table WHERE user_login = ‘username‘;” (Observe the encrypted password)
6. Type “UPDATE name-of-table SET user_pass=MD5(’new-password‘) WHERE user_login = ‘username‘;” (Updates the database with the encrypted password)
7. Type “SELECT ID, user_login, user_pass FROM name-of-table WHERE user_login = ‘username‘;” (To confirm password was changed)
8. Type “exit” (Exits the MySQL client)
9. Login to WordPress and using your username and new password.

If you don’t have this type of access or if this is too difficult for you, you can ask your web host to do it for you and once you have your new password, login and change the password to something you know and can remember.

Next part of this series will feature how to recover your Wordpress blog password using phpMyAdmin which is also a bit complicated but easier.

, , , , ,




Related Ads

Related Posts




















4 Comments For This Post

  1. George Gardner Says:

    Of course, you could also clear the database (or delete and re-create) just before deleting the wp-config.php file. (assuming it’s a fresh install and you have no important data in your database)

    Still, very cool. Thanks for this.

  2. Jaypee Says:

    @George - You can only do that for a fresh install and not if you want to keep all your data and just recover the password.

    You’re welcome! Thanks for dropping by. :)

  3. S B Says:

    Well all I would say is that your popst is helpful only to the nerds. I am newbie and what you wrote looks very cryptic to me. Although, I learned how to recover my password from another site, yet I thought that I let you know.

    A lot many visitors needing help may stumble upon this page and I wish they don’t waste their time :)

  4. Jaypee Says:

    @SB - Thanks for pointing that out! In case you haven’t read the second post, I’d like to let you know that this is a two part series and Part II is more user friendly in terms of instruction as it has some screenshots.

    I know what you mean and I appreciate you taking the time to share your feedback. If you think the other post is still to advanced for newbies, please let me know how I can improve it so I can make another post that will be more user-friendly. Thanks again and have a nice day! :)

2 Trackbacks For This Post

  1. How To: Recover Wordpress Password Part II » JaypeeOnline | Blogging News & Reviews Says:

    [...] part I of this series, I showed you how to recover your Wordpress password using the MySQL command line. This time, I’ll show you how to do it with [...]

  2. How To: Recover Wordpress Password Part II » JaypeeOnline // Blogging News & Reviews Says:

    [...] part I of this series, I showed you how to recover your Wordpress password using the MySQL command line. This time, I’ll show you how to do it with [...]

Leave a Reply


Live Comment Preview




GoDaddy.com SmartSpace