The tutorial below should be taken with a grain of salt. Please do your own research before proceeding as your local environment may differ.

There are several ways to reset your WordPress password. 

Even if you forget your password, WordPress has a built-in recovery mechanism that uses email.

In most circumstances, you can easily do this through the WordPress interface. 

To change your password in current versions:

  1. In the Administration Screen, menu, go to Users > All Users.
  2. Click on your username in the list to edit
  3. In the Edit User screen, scroll down to the New Password section and click the Generate Password button.
  4. If you want to change the automatically-generated password, overwrite it with a new password in the box provided. The strength box will show how good (strong) your password is.
  5. Click the Update User button.

Your new password takes effect immediately.

Change WordPress Password Using Softaculous:

if you have installed WOrdPress via our one-click installer, you can easily reset your WordPress password by:

  1. Log in to your cPanel
  2. Scroll down to Softaculous
  3. From the top-right, select All Installations
  4. Click on the Edit Installation button next to the installation for which you want to reset the password.
  5. On the Edit Installation page fill in the following fields :
  6. Admin Username: This will be the username for which you want to reset the password.
  7. Admin Password: This will be the NEW password.

After filling the above details, click on the Save Installation Details button to reset the password.

Once the password is reset you will see the success message.

You can now log in to your WordPress installation using the new password.

   

Change WordPress Password Using WordPress Automatic Emailer

If you know your username or the email account in your profile, you can use the "lost password" feature of WordPress.

  1. Go to your WordPress Login page (something like https://domain.com/wordpress/wp-login.php) where "domain" stands for the website you want to change its password.
  2. Click on the "Lost your password?" link
  3. You will be taken to a page to put in some details.
  4. Enter your username or the email address on file for that account.
  5. Wait happily as your new password is emailed to you.
  6. Once you get your new password, log in and change it to something you can remember on your profile page.

   

Change WordPress Password Using phpMyAdmin

  1. Log in to phpMyAdmin and clicking databases. A list of databases will appear.
  2. Click on your WordPress database.
  3. All the tables in your database will appear. If not, click Structure.
  4. Look for wp_users in the Table column.
  5. Click on the icon to browse.
  6. Locate your Username under user_login
  7. Click edit (may look like a pencil icon in some versions of phpMyAdmin)
  8. Your user_id will be shown, click on Edit
  9. Next to the user_pass is a long list of numbers and letters.
  10. Select and delete these and type in your new password.
  11. Type in the password you want to use. Just type it in normally, but remember, it is case-sensitive.
  12. In this example, the new password will be '*nzrp&ExE?*{*DwjN!hp='
  13. Once you have done that, click the drop-down menu indicated, and select MD5 from the menu.
  14.  Check that your password is actually correct, and that MD5 is in the box.
  15. Click the 'Go' button to the bottom right.
  16. Test the new password on the login screen. If it doesn't work, check that you've followed these instructions exactly.

   

Change WordPress Password Using SFTP

1. Log in to your site via SFTP (port 22) and download your active theme's functions.php file.
2. Edit the file and add this code to it, right at the beginning, after the first <?php:

$ wp_set_password( 'password', 1 );

Put in your own new password for the main admin user. The "1" is the user ID number in the wp_users table.

3. Upload the modified file back to your site.
4. After you then are able to log in, make sure to go back and remove that code. It will reset your password on every page load until you do.

   

Change WordPress Password Using WP CLI

WP CLI is a command-line tool for managing your WordPress installation.

1. Move to the /wordpress directory

$ cd /$WordpressLocation



where "$WordpressLocation" represents the location of your WordPress installation.

2. Type in the command:

$ wp user list

to see all users.

Find the ID of the user you'd like to update.

2. Then, update the user

$ wp user update 1 --user_pass=$*nzrp&ExE?*{*DwjN!hp=

replacing "1" with the id of the user you want to update.

   

Change WordPress Password Using MySQL/MariaDB Command Line

Get an MD5 hash of your password.

Visit md5 Hash Generator, or...

Create a key with Python. or...

On Unix/Linux:

Create file wp.txt with the new password in it (and *nothing* else)

tr -d '\r\n' < wp.txt | md5sum | tr -d ' -'
rm wp.txt


On Mac OS X:

  1. Create file wp.txt with the new password in it (and *nothing* else) using output redirection

    $ echo 'averylongandstrongpasswordt' > wp.txt 

    Use the following command to verify that your .txt file was created with the desired input:

    $ cat wp.txt

    Enter either of the lines below:

    md5 -q ./wp.txt; rm ./wp.txt

    (If you want the MD5 hash printed out)
    md5 -q ./wp.txt | pbcopy; rm ./wp.txt

    (If you want the MD5 hash copied to the clipboard)

    Note that nano and vi add a line break which changes the MD5 hash.

    You can also use:

    echo -n [averylongandstrongpasswordt] | md5
  2. "mysql -u user -p"
    (login to MySQL/MariaDB)
  3. enter your mysql password
  4. "use (name-of-database)" (select WordPress database)
    (select the WordPress database)
  5. "show tables;"
    (you're looking for a table name with "users" at the end)
  6. "SELECT ID, user_login, user_pass FROM (name-of-table-you-found);"
    (this gives you an idea of what's going on inside)
  7. "UPDATE (name-of-table-you-found) SET user_pass="(MD5-string-you-made)" WHERE ID = (id#-of-account-you-are-reseting-password-for);"
    (actually changes the password)
  8. "SELECT ID, user_login, user_pass FROM (name-of-table-you-found);"
    (confirm that it was changed)
  9. (type Control-D, to exit mysql client)

Note that our servers have a recent version of MySQL and some are running versions of MariaDB.

In that case, you can have MySQL/MariaDB compute the MD5 hash for you by skipping step 1. above.

Do the following for step 7. instead.


"UPDATE (name-of-table-you-found) SET user_pass = MD5('(new-password)') WHERE ID = (id#-of-account-you-are-reseting-password-for);" (actually changes the password)

Note that even if the passwords are salted, meaning they look like $P$BLDJMdyBwegaCLE0GeDiGtC/mqXLzB0, you can still replace the password with an MD5 hash, and WordPress will let you log in.

Was this answer helpful? 0 Users Found This Useful (0 Votes)