What to do if you have lost a WordPress Password
If you happen to know your last WordPress admin password and would like to change it, you can update the password at ease from the WordPress dashboard.
Step 1: Log into your WordPress dashboard
Step 2: On the left-hand menu, click on ‘Users’.
Step 3: Hover your mouse over the admin user and click ‘Edit’.
Step 4: Go to the very bottom and put in your new secure password twice or click on ‘Generate Password’ and click on ‘Update Profile’.
Step 5: You will then see that your admin profile has been updated.
Reset your WordPress password via email
If you cannot remember your WordPress admin password, you can reset it via email from the WordPress dashboard login page using the next steps:
- Navigate to your WordPress login page (example.com/wp-admin).
- Click ‘Lost your password?’ at the bottom.
- Fill in the username or email of your WordPress admin user before clicking on ‘Get New Password’.
- You will receive an email with the subject ‘[WordPress Site] Password Reset’. In this email you will receive a link below the text: ‘To reset your password, visit the following address’. Go ahead and click that link.
- Next you will be able to fill in your new password. After you do so, confirm and click on ‘Reset Password’.
Directly changing your WordPress password using phpMyAdmin
- Login to cPanel.
- Below the databases area, click on ‘phpMyAdmin’.
- Click on the name of your WordPress database.
- Then, click the ‘wp_users’ table.
- Press the ‘Edit’ button next to your WordPress admin user.
- Once you are in the ‘user_pass’ field, enter your password by pressing Ctrl –V. From the drop-down, choose ‘MD5′. Lastly, click on ‘Go’.
You will then see a success message from phpMyAdmin which says the database record was updated.
Changing your WordPress password via FTP
In case you do not have access to your WordPress database, you could just reset your password with FTP.
- Login to your website via FTP and go over to your theme’s ‘functions.php’ file and download it to your local computer.In our case it was: ‘/home/userna5/public_html/wp-content/themes/twentyfourteen/functions.php’
- On the second line, right after the first ‘<?php’ line append the following below.
In our example, we will be setting a password to password, then we will update it for the user admin. If your admin user happens to have a different username, you will want to ensure to be using that.
Make sure that you are using a secure WordPress password.
- Upload the edited ‘functions.php’ file back to your ‘/themes’ folder on the server.
- Login to your WordPress dashboard with the new temporary password you have just set.
- Since you have successfully reset your password, you may now delete the line ‘wp_set_password’ from the local ‘functions.php’ file and re-upload it. This is so that WordPress will not reset the password each time the admin dashboard is accessed going forward.
Using the Emergency Password Reset Script
In case the solutions above did not work for you, you can try using the Emergency Password Reset Script. This is not a plugin, it is a PHP script.
Things you need to know about this script:
You will have to know the admin username.
This script updates the admin password and sends an email to the admin’s email address.
If you do not receive an email, the password still changes.
The script is to be put at the root of your WordPress installation.
Deleting the script after finishing is extremely important for security reasons.
How to use the script.
- Copy the emergency script from here: Emergency Password Script. Put this into a file called ‘emergency.php’ at the root of your WordPress installation.
- Go to the script using your web browser. http://domain.com/emergency.php
- Fill in the WordPress admin username (usually just admin) and then the new password, then click on ‘Update options’.
- Remove the ‘emergency.php’ file from the server after you are finished with it. Do not leave this script on your account, otherwise it becomes a security risk which will allow somebody to use it and change your password.