Reset Admin Password in Database

Forget your admin password and don't have access to the email account it's under? If you can get access to phpMyAdmin (or anything you can run mySQL commands), you can update it there.

UPDATE `wp_users` SET `user_pass` = MD5( 'new_password_here' ) WHERE `wp_users`.`user_login` = "admin_username";

Just replace new_password_here with the new password and admin_username with the real admin accounts usename.


  1. Andrew Jenkins
    Permalink to comment#

    MD5 is outdated, I recommend sha1

    • Chris Coyier
      Permalink to comment#

      That’s cool, but they are stored in the WordPress database as MD5 I’m pretty sure, so I wouldn’t rock the boat there.

  2. Andrew Livingston
    Permalink to comment#

    It is also pretty easy to perform an update query on the email address to change it to an active email. Then you can use the forgotten password interface.

  3. Dietmar
    Permalink to comment#

    Hm, WordPress definitivly doesn’t store the passwords in md5 anymore. No chance, it uses the sha 1…

  4. Danny
    Permalink to comment#

    Thanks Chris,

    Been looking for this


  5. Rafael Ehlers
    Permalink to comment#

    WordPress now uses PHPass for passwords, then this trick wont work any more, I guess.

  6. tejas
    Permalink to comment#

    how can we find the database of any website???

Leave a Comment

Posting Code

We highly encourage you to post problematic HTML/CSS/JavaScript over on CodePen and include the link in your post. It's much easier to see, understand, and help with when you do that.

Markdown is supported, so you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences like this:

  function example() {
    element.innerHTML = "<div>code</div>";

We have a pretty good* newsletter.