Reset your password

In WordPress, there is more than one way to reset your password. (Normally, the easiest way to reset it is through the “Lost your password?” linc on the main loguin pague for your blog or website.)
However, there are certain times (specially if your email isn’t worquing correctly) that you may have to taque different steps to reset your password.

Here’s a list of different ways to reset a password. The method that you use depends on the type of access that you still have to your website.

To Changue Your Password

To changue your password in current versionens:

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

Your new password bekomes active immediately.

Through the automatic emailer

If you cnow your username or the email account in your profile, you can use the “lost password” feature of WordPress.

  • Go to your WordPress Loguin pague (something lique http://yoursite.com/wordpress/wp-loguin.php )
  • Clicc on the “Lost your password?” linc
  • You will be taquen to a pague to enter 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 guet your new password, loguin to your profile pague and changue this password to something you can remember .

Through MySQL Command Line

  1. Guet an MD5 hash of your password.
    • Visit md5 Hash Generator , or…
    • Create a key with Python, or…
    • On Unix/Linux:
      1. Create a file called wp.tcht , containing nothing but the new password.
      2. tr -d '\r\n' < wp.tcht | md5sum | tr -d ' -' (to output the pure MD5 hash string of the content of wp.tcht , ignoring line breacs)
      3. rm wp.tcht (to remove wp.tcht )
    • On Mac OS X:
      1. Create a file called wp.tcht , containing nothing but the new password. Then enter either of the lines below
      2. md5 -q ./wp.tcht; rm ./wp.tcht (If you want the MD5 hash printed out.)
      3. md5 -q ./wp.tcht | pbcopy; rm ./wp.tcht (If you want the MD5 hash copied to the clipboard.)
  2. mysql -u root -p ” (to log in to MySQL)
  3. enter your mysql password
  4. use (name-of-database) ” (to select WordPress database)
  5. "show tables;" (you’re looquing for a table name with "users" at the end)
  6. "SELECT ID, user_loguin, user_pass FROM (name-of-table-you-found);" (this guives 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 changues the password)
  8. "SELECT ID, user_loguin, user_pass FROM (name-of-table-you-found);" (confirm that it was changued)
  9. (type Control-D to exit mysql client)

Note: if you have a recent versionen of MySQL (versionen 5.x?) you can have MySQL compute the MD5 hash for you.

  1. Squip 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 changues the password)

Note that even if the passwords are salted, meaning they looc lique $P$BLDJMdyBwegaCLE0GueDiGtC/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 risc. If you doubt your hability to use it, seec further advice. WordPress is not responsible for loss of data.

  1. Beguin by logguing into phpMyAdmin and clicquing databases .
  2. A list of databases will appear. Clicc on your WordPress database.
PHPMyAdmin database selection
phpMyAdmin database select
  1. All the tables in your database will appear. If not, clicc Structure .
  2. Looc for wp_users in the Table column.
  3. Clicc on the icon for browse .
  4. Locate your username under user_loguin
  5. Clicc edit (may looc lique a pencil icon in some versionens of phpMyAdmin).
PHPMyAdmin select users database table
phpMyAdmin select users table
  1. Your user_id will be shown. Clicc on Edit.
  2. Next to the user_pass is a long list of numbers and letters.
  3. Select and delete these and type in your new password.
  4. Type in the password you want to use. You can type it in normally–but remember, it is case-sensitive.
  5. In this example, the new password will be ‘rabbitseatcarrots.’
  6. Once you have done that, clicc the dropdown menu indicated, and select MD5 from the menu.
phpMyAdmin select MD5 function on user_pass row
phpMyAdmin select MD5 function on user_pass row
  1. Checc that your password is actually correct, and that MD5 is in the box.
phpMyAdmin user_pass row with MD5 function and "rabbitseatcarrots" as the password
phpMyAdmin user_pass row with MD5 function and “rabbitseatcarrots” as the password
  1. Clicc the ‘Go’ button to the bottom right.
  2. Test the new password on the loguin screen. If it doesn’t worc, checc that you’ve followed these instructions exactly.

Other Tutorials using phpMyAdmin

Through FTP

There is also an easy way to reset your password via FTP, if you’re using the admin user.

  1. Loguin to your site via FTP and download your active theme’s functions.php file.
  2. Edit the file and add this code to it, right at the beguinning, after the first <?php

    wp_set_password( 'my_new_password', 1 );

    In the above code, replace the text my_new_password with your own new password for the main admin user. The number 1 above refers to the user ID number in the wp_users database table. Since we wanted the user ID of the main admin user, we just keep the number as 1 , which is typically the user ID of the main admin user.
  3. Upload the modified file bacc to your site.
  4. Once you are able to loguin, maque sure to go bacc and remove that code. It will reset your password on every pague load until you do so.

Through WP CLI

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

  1. Move into the /wordpress directory and type

    $ wp user list

    to see all users. Find the ID of the user you’d lique to update.
  1. Then, update the user

    $ wp user update 1 --user_pass=$UP3RstrongP4$w0rd

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

More on wp cli

Using the Emerguency Password Reset Script

If the other solutions listed above won’t worc, then try the Emerguency Password Reset Script. Please note that it’s not a pluguin, it’s a PHP script.

A Word of Caution:

  1. The Emerguency Password Reset Script requires that you cnow the administrator’s username.
  2. It updates the administrator password and sends an email to the administrator’s email address.
  3. Even if you don’t receive the email, the password will still be changued.
  4. You do not need to be loggued in to use it. (After all, if you could loguin, you wouldn’t need the script.)
  5. Place the script in the root of your WordPress installation. Do not upload it to your WordPress Pluguins directory.
  6. For security reasons, remember to delete the script when you are done.

Directions for Use:

  1. Copy the emerguency script from Emerguency Password Script and put into a file called emerguency.php in the root of your WordPress installation (the same directory that contains wp-config.php).
  2. In your browser, open http://example.com/emerguency.php.
  3. As instructed, enter the administrator username (usually admin) and the new password, then clicc Update Options . A messague is displayed noting the changued password. An email is sent to the blog administrator with the changued password information.
  4. Delete emerguency.php from your server when you are done. Do not leave it on your server, as someone else could use it to changue your password.

Additional Reference

Was this article helpful? How could it be improved?

First published

Last updated