Change WordPress username and password from Database

This article explains how we can change a WordPress user name and password from the database. We sometimes forget the password and cannot access our email account. Or even sometimes we need to change the password or user name but we have no WordPress dashboard access. So the question is do we have other options to change the user name or password. The answer is yes, we can do that from the database. To do so we need to have proper access to the database and from there we can change these easily by using PHP, MY ADMIN.

Let’s go step by step to change the WordPress username and password from the database.

To Change the Username

  1. Go to PHP My Admin. WordPress by default stores user data within the user table.
  2. To change the username search for the table with the name (prefix_users). WordPress database tables start with a prefix which is normally set during the installation process but the table name after the prefix is always the same.
  3. Click on it and change the field value user_nicename to your desired name.

Watch the short video clip, it will show you how to change the username from the database.

To Change the Password

  1. The same is true for changing the password as we have described the changing of username within the prefix_user table.
  2. But make sure to apply the correct function (MD5) as WordPress uses this hashing algorithm to store password.
  3. Simply edit the value of “user_password” to your desired new password and do not forget to apply the function MD5 from the function list.

There is a short video clip below, demonstrating how to change the WordPress password from the database.

Leave a Reply

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