Code Snippet

Home » Code Snippets » WordPress » Reset Admin Password in Database

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.

Subscribe to The Thread

  1. MD5 is outdated, I recommend sha1

    • 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. 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. Hm, WordPress definitivly doesn’t store the passwords in md5 anymore. No chance, it uses the sha 1…

  4. Thanks Chris,

    Been looking for this

    Danny

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

Speak, my friend

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
~ The Management ~