If you lost or can’t remember your WordPress admin password, you can use several methods to reset it. We’ll cover all of them in this article.
(Easy) lost your password link
The first method you should try if you’ve lost your password is to use the Lost your password link on your website’s login page. Head to https://yourwebsite.com/wp-login.php (replace yourdomain.com with your actual domain name). Click the Lost your password? link below the login form:

This will take you to another form where you need to input your username or your email address:

Once you fill in your username/email address, the password reset link will be sent to your email address, which you can click to go ahead and reset the password for the specified username.
(Easy) WordPress Manager Password Reset
To reset your admin password using the WordPress Manager feature, click on the WordPress Manager link under the Quick Shortcuts section from your client area:

Find your WordPress installation from the list and click the down-facing arrow on the right to expand details, then click Manage Users option:

Select the desired user from the list, and fill in or generate the new password:

Click the Save button to save changes.
(Medium) PHPMyAdmin password reset
This method is a bit more tricky, but not very complicated. To reset the admin password using the PHPMyAdmin application, log in to your cPanel control panel. Click here to see how to login to cPanel.
Under the Databases section, click the phpMyAdmin link:

Next, click on your WordPress installation’s database from the left frame:

Click on the wp_users table in the right frame (in this example, it’s called wphq_users as the prefix may vary):

Click the Edit button next to your admin username:

Paste or fill in your password in the Value field under the user_pass row, and select the MD5 option in the Function column. Click the Go button once ready to save changes.

(Advanced) Password reset via theme file
This method is a bit more advanced as it requires an edit of the theme file.
Log in to your cPanel control panel. Click here to see how to login to cPanel.
Click the File Manager under the Files section:

Edit the functions.php file for your active theme. If your WordPress website is your main website, the example path is:
/home/username/public_html/wp-content/themes/your_theme/functions.php
In our example, the path is:
/home/username/public_html/test2/wp-content/themes/twentytwenty/functions.php
Select the functions.php file with your mouse, and click the Edit button in the top menu ribbon:

On the second line, right after the <?php opening tag, insert the following code:
wp_set_password(‘password’,’admin’);
Replace the following values: password – your new password admin – your admin username

Once ready, click the Save Changes button to save the changes.
Now you can log in to your WordPress Dashboard with the temporary password you’ve set. Change your password to the new password, and then remove line 2 from the functions.php file to avoid having your password reset each time you access your WordPress Dashboard.
(Advanced) emergency password reset script
If none of the methods above work for you, you can try using the emergency password reset script. There are a couple of caveats to using this script:
- You need to know your admin username
- It updates the admin password and sends it directly to the admin email address
- In case you can’t receive emails to your admin email address – the password is still reset
Save the script from the following article to an emergency.php file, and upload it to your WordPress root directory (where the wp-config.php file resides).
Once completed, visit the https://yourdomain.com/emergency.php URL (replace yourdomain.com with the actual domain name). Fill in the administrator username and the new password, and click the Update Options button. You will then receive a success confirmation message and an email to the administrator’s email address.
Make sure to remove the emergency.php file from your account on the password reset is completed.