Home > Help Center > Applications > WordPress > WordPress - Reset Your Password

WordPress - Reset Your Password

WordPress has more than one way to set your password. Under normal circumstances, you can do it through the WordPress interface. If you forget your password, WordPress has a built-in recovery mechanism that uses email.

For various reasons, the email service may not work correctly, so it is a very comfortable opportunity to rely on several tools to recover your password.

Here's a list of five different ways to reset your password:

  • The Default Way to Change WordPress Password
  • Using Lost Password Feature
  • Using PHP Function
  • Using the Emergency Password Reset Script
  • Through phpMyAdmin

Each one will work and you only need one to succeed. Which method you use depends on what type of access you still have on your website.

The Default Way to Change WordPress Password

To change your password follow these steps:

Click Users > All Users, hover over username and click Edit link to enter Profile screen.

wordpress reset password

You can access the same profile screen clicking on Users > Your Profile:

wordpress reset password

Scroll down to Account Management section and click Generate Password button:

wordpress reset password

If you are logged in from more devices, Log Out Everywhere Else will become an active button and you have to click it first to destroy all active sessions.

Copy the secure password in a file and click Update Profile button.

wordpress reset password

Log in with your new password.

Using Lost Password Feature

To use this main tool you need to know either WordPress(WP) username or associated email address.

If so, go to your login page (example: http://hostpulse-demo.com/wp-admin) and click on Lost your password? Link.

wordpress reset password

On the next screen enter your username or email and click Get New Password button:

wordpress reset password

wordpress reset password

Login your admin mail box and click the link in the email:

wordpress reset password

Copy the suggested password or enter your own and click the Reset Password button:

wordpress reset password

Login with your updated password.

Using PHP Function

You can reset your WP Password by adding a built-in wordpress PHP function wp_set_password() in functions.php file.

The file functions.php is a vital part of every WP theme.

You can access it through the CPanel's file manager.

Navigate to WP folder > wp-content > themes > 'active-theme' (twentyseventeen in the example).

Select functions.php file and click on Edit icon and add this code to it, right at the beginning, after the first <?php:

wp_set_password( 'password-string', 1 );

(be careful to not delete single quotes around the password, replace password-string with your actual password, something way more secure like J4cqSO8ycGvU)aprky):

wordpress reset password

If you were loged in your current session will be destroyed and you have to log in again with the new password.

Upon successful login go back and remove only the added code.

You can access functions.php file also through FTP.

Login to your FTP account, navigate to the active WP theme files and download functions.php on your computer.

Open it with your code editor, add the same above function, save the file and upload it back to the server.

After successful login with the new password do not forget to download again functions.php, to remove the added code and to upload the file back.

Using the Emergency Password Reset Script

To use emergency script you must know the administrator username. The script will update the administrator password and will send email to the administrator's email address.

Follow the next steps to reset your password with the emergency script:

  • Open CPanel's file manager and navigate to WP root folder (the same directory that contains wp-config.php).
  • Create new empty file emergency.php

wordpress reset password

  • Copy the emergency script from Emergency Password Script and paste it into emergency.php
  • Open http://hostpulse-demo.com/emergency.php in your browser

wordpress reset password

  • Enter the administrator username and the new password, then click Update Options. A new message is displayed to confirm the password is changed. An email is sent to the blog administrator with the changed password information.
  • Delete emergency.php from your server.

wordpress reset password

This script is intended to be used as a last resort by WordPress administrators that are unable to access the database. Usage of this script requires that you know the Administrator's user name for the WordPress install.

Through phpMyAdmin

Using phpMyAdmin to reset WP password is considered more advanced (and more risky also) in comparison with other methods described here.

But if you follow the example you'll see there is nothing so complicated to be scared of.

We strongly recommend before making significant changes on your WP site (always) to export an archive of your database on your computer.

With such archive if something goes wrong you just select and drop all database tables (not database itself) and import the archive to recover everything the way it was before.

From your CPanel open phpMyAdmin and click on the WP database name. If you are not sure which database is the correct one check wp-config.php file.

wordpress reset password

Click on hstpls_users table (your table prefix surely is different then mine, so you look for your-prefix_users table):

wordpress reset password

Click on Edit icon:

wordpress reset password

Find user_pass row and delete the encrypted string:

wordpress reset password

Replace newpassword with your password and from the dropdown menu select MD5 encryption method:

wordpress reset password

Check that your password is correct and that MD5 is in the box.

Click Go button.

Test the new password on the login screen.

Summary

Of course these are not all possible ways to reset WP password but the described above 5 ways are strong guarantee you'll never be unable to log in your WordPress site.

#wordpress #security #password

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support