WordPress Admin Password Reset Script

There’s a useful script that you can use to reset your WordPress admin password if you have forgotten it and the “normal” password recovery methods – e.g. using the “Lost your password?” link on the login page – don’t seem to work. It’s a standalone script (not a plugin) and doesn’t require you to be logged in to use it.

So why am I writing a YAGOHT (Yet Another Guide On How To [do something]) when there’s a solution already available? The thing is that script was released more than a year ago and was last tested (at least by its author) with WP 2.3.x. Also, I thought the script could use some additional features. It’s released under GPL, so I just went ahead and made my changes. You can download the New And ImprovedTM version below.

New Features* And Changes

  • Updated design to WP 2.6 styles and verified compatibility with 2.6.
  • Added an option to automatically delete the password reset file (or you might forget to do it manually, which would be really bad for your site’s security). This option will only appear if PHP has write access to the file.
  • Instead of entering the admin username you can select any username from a dropdown. The original script would only let you change the password for the first user created on that blog, and you had to correctly enter the username before it would work.
  • Added a bit more error checking.

* the definition of “feature” is entirely subjective here ;)

Download Password Reset Script

emergency.zip (3 KB)

How To Use It

Pretty much the same way as you would use the original script.. Here’s the abridged version :

  1. Uzip emergency.zip.
  2. Upload emergency.php to the WP root.
  3. Open it in your browser.
  4. Follow on-page instructions.
  5. Delete emergency.php (if it wasn’t done automatically).

And use some kind of password manager so that you don’t lose the password again. Mine is an encrypted RAR archive, but I’m sure you can do better ;)

Obligatory blog post personalization statement : I like Bleach (anime/manga). The fights get predictable and talky after a while, but it’s fun overall. …oh wait, how was this “have a personality” thing supposed to work again?…

Related posts :

4 Responses to “WordPress Admin Password Reset Script”

  1. thaddeusmt says:

    Pretty slick! I was having trouble with the new hash in 2.6, but this worked like a charm. Thanks!

  2. George says:

    Did you mention something about using a password manager? Try this one, Web Replay, here: http://deskperience.com/l/2/passwordmanager.html?source=raz. Very happy with it. They have free downloand. Enjoy

    Regards,
    George

  3. Pretender says:

    Excellent solution. I forgot admin password too and I didn’t find the function that generates it. Thanks!

Leave a Reply