When the administrator password is lost or you forget the username for your WordPress dashboard, the password can be reset and the username can be recovered. This article will explain how to reset the password with the wp_set_passwors function and through phpMyAdmin, and how to recover your username from phpMyAdmin.

Easy method - Using the "Forgot Password?" button

If you have an email address that you have access to defined within your Wordpress admin user account, you can simply click on the "Forgot Password?" button below the login form. After doing so, it will send your password to the email account on file for that user.

Changing the password with wp_set_password();

The WordPress password can be changed by adding code to the functions.php file in your theme folder. Below are the steps to accomplish this..

  1. Login into your cPanel.
  2. Navigate to the following location of your theme folder through the File Manager.

    /public_html/your-user/wp-content/themes/your-theme/functions.php

  3. Edit the file with the code editor. Add the following code to the beginning of the file directly after <?php:
  4. wp_set_password('password',1);

  5. Save the file.
  6. Go to your WordPress admin and log in with the new password.

    Important! Make sure you remove the code and update your password. If not, the page will continually reset the password with the script.

Changing the password in the WordPress Administrator Dashboard

The administrator dashboard allows you to change passwords using the USERS option:
  1. Login to the WordPress Dashboard.
  2. Choose USERS from the Administrator Panel.
  3. Hover over the username that requires the password reset and then click on EDIT when it appears under the user name.
  4. Scroll down to the New Password field and enter the new password.
  5. Repeat the password in the Repeat New Password to confirm the change.
  6. Click on Update Profile in order to save the new password.

PhpMyAdmin: Find the Username and reset the password

Resetting your password or recovering your username through PhpMyAdmin can be an easier way . The following steps will explain how to reset your WordPress Dashboard password and find your username with PhpMyAdmin.

Important! Always remember to have a backup of your database before doing any direct editing on that database.

  1. Login into your cPanel.
  2. Go to Databases > PhpMyAdmin.
  3. Select your wordpress database on the left side. 
  4. You should see a list of all your tables in the Wordpress database.

    Select the wp_users table.

  5. Locate your Username or the first user (The first user is usually the administrator user) in the list.

    Click Edit (The pencil icon).

  6. Here is where you can recover the username and reset the password.

    The user_login field is the username for the admin login.

    The user_pass field is where the password is stored.

    Type a new password in the password field.

  7. Click on the dropdown box in the "function" field and select MD5 from the list

    Click "Go"

  8. Now you can go to your wp-admin dashboard and login with the new password.
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Wordpress Security

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}