Forgot your WordPress password? 4 easy ways to recover it

It’s common to forget your WordPress login password, especially if you manage multiple sites or user accounts. Fortunately, as the site and hosting owner, you have several safe and effective ways to reset it. In this article, we explain four methods to help you regain access to your admin panel.

 

1. Recover your password from the WordPress login screen

This is the quickest and easiest method:

  1. Go to the login screen: https://yoursite.com/wp-login.php
  2. Click on Lost your password?
  3. Enter your email address or username.
  4. Check your inbox and follow the link to set a new password.
This method depends on your site’s email system working properly. If you don’t receive the email, try one of the following methods.

 

2. Change the password via phpMyAdmin

If you have hosting access, you can change the password directly in the database:

  1. Access phpMyAdmin from your hosting control panel (cPanel, Plesk, etc.).
  2. Select your WordPress database.
  3. Locate the table ending in _users (e.g., wp_users).
  4. Click Browse and find your username.
  5. Click Edit on the corresponding row.
  6. In the user_pass field, select MD5 from the function column and enter your new password in plain text.
  7. Save the changes.
WordPress used MD5 to encrypt passwords in the past, but now uses more secure hashing methods. This technique still works but should only be used as a temporary fix.

 

3. Change the password without phpMyAdmin (using another database tool)

If you don’t have access to phpMyAdmin and use a different database tool, you can still change your password:

  1. Open your preferred database manager.
  2. Select the WordPress database.
  3. Find the table ending in _users (e.g., wp_users).
  4. Locate your user row and edit the user_pass field.
  5. Since WordPress expects the password in MD5 format, use an external tool to convert your new password to MD5. For example: MD5 Hash Generator
  6. Copy the generated MD5 hash and paste it into the user_pass field.
  7. Save the changes.
Be sure to use a trusted tool to generate the hash. After regaining access, consider resetting your password from the WordPress admin panel to store it using a stronger encryption method.

 

4. Create a new admin user with PHP snippet

You can also recover access by creating a temporary administrator account. All you need is access to the site files (via FTP or the hosting file manager):

  1. Open the functions.php file of your active theme (located in /wp-content/themes/your-theme/).
  2. Add the following code to the end of the file:
    • <?php
      function letsGoDevCreateTempAdmin() {
          $username = 'adminTemp';
          $password = 'SecurePassword123';
          $email = 'email@yourdomain.com';
      
          if ( ! username_exists( $username ) ) {
              $userId = wp_create_user( $username, $password, $email );
              $user = new WP_User( $userId );
              $user->set_role( 'administrator' );
          }
      }
      add_action( 'init', 'letsGoDevCreateTempAdmin' );
      

       

  3. Save the changes and log in using the new account.
  4. After restoring access, remove this code from functions.php.

 

Recommendations

  • Enable two-factor authentication (2FA) to improve security.
  • Use a secure password manager to store your credentials safely.
  • Make sure WordPress emails are delivered correctly—consider configuring SMTP if needed.

 

Earn a 35% commission on every sale: Join here.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to Top
0
Would love your thoughts, please comment.x
()
x