Regaining access to WordPress

Just saw this on LinkedIn…  Haven’t tested it, but looks workable.

The problem: lost WordPress administrator password and no way for WordPress to send e-mail, so the conventional password reset isn’t an option.  However, direct access to the database (via phpMyAdmin or otherwise) is available.

The solution: a two-part hack.

Part one.  Create an activation key manually:

UPDATE `wp_users` 
SET `user_activation_key` = '123456789' 
WHERE `user_login` = 'adminUserName';

(Obviously, wp_users and adminUserName must be replaced with the installation-specific values.)

Part two.  Reset the password by going to the password reset page:

[WordPress root]/wp-login.php?action=rp&key=123456789&login=adminUserName

On further thought, the first step could be even simpler; even if WordPress was unable to send a password reset e-mail, it probably still created the activation key, so it could be looked up in the wp_users table, rather than written into it…

This entry was posted in Technology. Bookmark the permalink.

One Response to Regaining access to WordPress

  1. Kaare Mulvad says:

    Thanks for this, worked like a charm but just copying the already created activation key 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *