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. User Avatar
    Andrew Jenkins
    Permalink to comment#

    MD5 is outdated, I recommend sha1

    • User Avatar
      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. User Avatar
    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. User Avatar
    Permalink to comment#

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

  4. User Avatar
    Permalink to comment#

    Thanks Chris,

    Been looking for this


  5. User Avatar
    Rafael Ehlers
    Permalink to comment#

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

  6. User Avatar
    Permalink to comment#

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

Leave a Comment

Posting Code!

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.