Reset WordPress Password

Reset WordPress Password

Source: https://codex.wordpress.org/Resetting_Your_Password

In WordPress, there is more than one way to set your password. In 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.

But on some hosts, especially when email isn't working right, sometimes you have to take different steps to reset your password.

Here's a list of different ways to reset a password. Any one of them will work, and you only need one to succeed. Which method you will use depends on what type of access you still have to your website.

To Change Your Password

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 Generate Password button.
  4. If you want to change the automatically generated password, overwrite it in 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.

Through the automatic emailer

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

  • Go to your WordPress Login page (something like http://yoursite.com/wordpress/wp-login.php)
  • Click on the Lost your password? link
  • You will be taken to a page to put in some details. Enter your username or the email address on file for that account.
  • Wait happily as your new password is emailed to you.
  • Once you get your new password, login and change it to something you can remember on your profile page.

Through MySQL/MariaDB Command Line

  1. Get an MD5 hash of your password.
    • Visit md5 Hash Generator, or...
    • Create a key with Python. or...
    • On Unix/Linux:
      1. Create file wp.txt with the new password in it (and *nothing* else)
      2. tr -d '\r\n' < wp.txt | md5sum | tr -d ' -'
      3. rm wp.txt
    • On Mac OS X:
      1. Create file wp.txt with the new password in it (and *nothing* else), then enter either of the lines below
      2. md5 -q ./wp.txt; rm ./wp.txt (If you want the MD5 hash printed out)
      3. md5 -q ./wp.txt | pbcopy; rm ./wp.txt (If you want the MD5 hash copied to the clipboard)
  2. "mysql -u root -p" (log in to MySQL/MariaDB)
  3. enter your mysql password
  4. "use (name-of-database)" (select 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 if you have a recent version of MySQL (version 5.x?) or any version of MariaDB, you can have MySQL/MariaDB compute the MD5 hash for you.

  1. Skip step 1. above.
  2. 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.

Through phpMyAdmin

This article is for those who have phpMyAdmin access to their database. Note: use phpMyAdmin at your own risk. If you doubt your ability to use it, seek further advice. WordPress is not responsible for loss of data.


    • Related Articles

    • How to login to your WordPress site.

      Step 1: Please typing in your site’s domain name into your browser, and add /wp-admin at the end: Example: It should look something like this:  https://www.example.com/wp-admin Step 2: Once you are at your log-in screen, enter your assigned username ...
    • Learning WordPress

      The WordPress codex provides documentation for those just beginning with WordPress and for expert users alike.  https://codex.wordpress.org/Main_Page
    • How to Duplicate Portfolio Item

      Step 1 : Install Duplicate Post plugin. https://wordpress.org/plugins/duplicate-post/ Step 2: Go to Settings Step 3: Click on the permissions tab. Step 4: Then under "Enable for these post types" check the portfolio box.