WordPress lost admin password – Resetting
If you are using WordPress there is more than one way to set your password.
Normal circumstances, you can do it through the WordPress interface, but iIf you forget your password then WordPress has a built in recovery mechanism that uses email.
To Change Your WordPress Password
To change your password in current versions:
- In the Admin Panel menu, go to USERS
- Click on your username in the list to edit
- In the Edit User screen, scroll down to the New Password section and type in a new password in the two boxes provided. The strength box will show how good (strong) your password is.
- Click the UPDATE PROFILE button
Your new password takes effect immediately.
Through the automatic emailer
If you know your username and 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 lost password
- You will be taken to a page to put in some details. Enter your user name and 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 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)
- md5sum wp.txt
- rm wp.txt
- “mysql -u root -p” (log in to MySQL)
- enter your mysql password
- “use (name-of-database)” (select WordPress database)
- “show tables;” (you’re looking for a table name with “users” at the end)
- “SELECT ID, user_login, user_pass FROM (name-of-table-you-found)” (this gives you an idea of what’s going on inside)
- “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)
- “SELECT ID, user_login, user_pass FROM (name-of-table-you-found)” (confirm that it was changed)
- (type Control-D, to exit mysql client)
Note if you have a recent version of MySQL (version 5.x?) you can have MySQL compute the MD5 hash for you.
- Skip 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)
Through FTP
There is also an easy way to reset your password via FTP, if you’re using the admin user.
1. Login 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 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 login, make sure to go back and remove that code. It will reset your password on every page load until you do.
Using the Emergency Password Reset Script
If the other solutions listed above won’t work, then try the Emergency Password Reset Script. It is not a Plugin. It is a PHP script.
- Warnings
- Requires you know the administrator username.
- It updates the administrator password and sends an email to the administrator’s email address.
- If you don’t receive the email, the password is still changed.
- You do not need to be logged in to use it. If you could login, you wouldn’t need the script.
- Place this in the root of your WordPress installation. Do not upload this to your WordPress Plugins directory.
- Delete the script when you are done for security reasons.
- Directions for use
- Copy the emergency script from Emergency Password Script and put into a file called emergency.php in the root of your WordPress installation (the same directory that contains wp-config.php).
- In your browser, open http://example.com/emergency.php.
- As instructed, enter the administrator username (usually admin) and the new password, then click Update Options. A message is displayed noting the changed password. An email is sent to the blog administrator with the changed password information.
- Delete emergency.php from your server when you are done. Do not leave it on your server as someone else could use it to change your password.
Changing your password in older versions
To change your password in WordPress v1.2:
- In the Admin Panel, go to PROFILE
- Scroll down to the bottom and type in the new password in the two boxes provided
- Click the UPDATE PROFILE button
- Your new password takes effect immediately.
To change your password in WordPress v1.5:
- In the Admin Panel, go to USERS
- From the “Your Profile” tab, scroll to the bottom and type in the new password in the two boxes provided.
- Click the UPDATE PROFILE button
- Your new password takes effect immediately.
To change your password in WordPress v2.0:
- In the Admin Panel, go to USERS (or Profile)
- From the “Your Profile” tab, scroll down to the Update Your Password section and type in a new password in the two boxes provided.
- Click the UPDATE PROFILE button
- Your new password takes effect immediately.
- Â

