How to reset password in WordPress?

If you forget or lost the password of your account, WordPress gives you an option to reset it through different methods.

There are four ways to reset WordPress password:

  • Change password from the dashboard
  • Reset password via email
  • Manually reset the password through database via PhpMyAdmin
  • Using emergency password reset script

To reset a password in WordPress, you have a few options:

  1. Through the login page:
    • Go to the login page of your WordPress site (typically located at yoursite.com/wp-login.php).
    • Click on the “Lost your password?” link.
    • Enter your username or email address associated with your WordPress account.
    • WordPress will send a password reset link to the email address associated with your account.
    • Check your email and follow the link to reset your password.
  2. Through the WordPress database (if you have access):
    • Access your WordPress database using phpMyAdmin or another database management tool.
    • Find the wp_users table (the prefix may differ if you’ve changed it during installation).
    • Locate your username or email address in the table.
    • Find the user_pass field and update it with a new password. Make sure to use the MD5 function for encryption. Alternatively, you can use the “Edit” option and choose MD5 from the drop-down menu for the user_pass field.
    • Save the changes.
  3. Using FTP (if you have access to your WordPress files):
    • Connect to your website using an FTP client.
    • Navigate to the wp-content/themes/ directory and find your active theme’s folder.
    • Look for the functions.php file and download it to your computer.
    • Open the functions.php file in a text editor and add the following code at the end:
    php
    wp_set_password( 'new_password', 1 );

    Replace 'new_password' with your desired password.

    • Save the changes and upload the modified functions.php file back to your server.

Please note that the third method is a quick way to reset the password, but it’s essential to remove the added code after the password has been reset to prevent any security risks.