How To Reset Your WordPress Admin Password

SkyStra
Dec 12, 2020

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) Skystra Apps Password Reset

To reset your admin password using the Skystra Apps feature, log in to your cPanel control panel. Click here to see how to login to cPanel.

Scroll down to the Skystra Apps section, and click the WordPress icon:

Click the pencil icon next to the desired WordPress website under the Current Installations section (the Options column):

Scroll down to the Admin Account section, and fill in the Admin Password field:

Click the Save Installation Details button once ready to save the 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 the desired database in 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.