Reset WordPress Admin user password in database

Posted in Tutorials

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

If the wordpress admin forgot their password, try the “lost password” link in the login page.  If that fails, then you have to reset the password in the database.  This tutorial will explain how to do this in WordPress 3.5.  In the instructions, the table names and field names are shown without the database prefix as that will be different for each installation.  But you can figure out what I mean.

1.  You have to have access to the database on the webhost.  The database name, database user, and database user password all can be found in wp-config.php at the root of the WordPress install.

2.  Use phpMyAdmin to go to the _users table.  Find and edit the record for the admin user.  If it is not obvious from the username, determine the id of the admin user by looking in the _usermeta table with _capabilities containing “administrator” and _user_level 10.

3.  Now you are editing the admin user record in the _users table.

edit admin password

The password is stored encrypted with MD5.  But in the latest version of phpMyAdmin, you can edit the user_pass field by typing in the password straight and selecting the MD5 function (see above).  phpMyAdmin will encrypt it for you.

Save record and login with new password.

Another way to reset an user password without needing to go into the database is to use the wp_set_password command in the functions.php file as describe in our other tutorial.