When the administrators 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_password(); 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..
- Login into your cPanel.
- Navigate to the following location of your theme folder through the File Manager.
- Edit the file with the code editor. Add the following code to the beginning of the file directly after <?php:
- Save the file.
- 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
- Login to the WordPress Dashboard.
- Choose USERS from the Administrator Panel.
- Hover over the username that requires the password reset and then click on EDIT when it appears under the user name.
- Scroll down to the New Password field and enter the new password.
- Repeat the password in the Repeat New Password to confirm the change.
- 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.
- Login into your cPanel.
- Go to Databases > PhpMyAdmin.
- Select your wordpress database on the left side.
- You should see a list of all your tables in the Wordpress database.
Select the wp_users table.
- Locate your Username or the first user (The first user is usually the administrator user) in the list.
Click Edit (The pencil icon).
- 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.
- Click on the dropdown box in the "function" field and select MD5 from the list
- Now you can go to your wp-admin dashboard and login with the new password.