WordPress - Reset Your Password
WordPress has more than one way to set your password. Under 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.
For various reasons, the email service may not work correctly, so it is a very comfortable opportunity to rely on several tools to recover your password.
Here's a list of five different ways to reset your password:
- The Default Way to Change WordPress Password
- Using Lost Password Feature
- Using PHP Function
- Using the Emergency Password Reset Script
- Through phpMyAdmin
Each one will work and you only need one to succeed. Which method you use depends on what type of access you still have on your website.
The Default Way to Change WordPress Password
To change your password follow these steps:
Click Users > All Users, hover over username and click Edit link to enter Profile screen.
You can access the same profile screen clicking on Users > Your Profile:
Scroll down to Account Management section and click Generate Password button:
If you are logged in from more devices,
Log Out Everywhere Else will become an active button and you have to click it first to destroy all active sessions.
Copy the secure password in a file and click Update Profile button.
Log in with your new password.
Using Lost Password Feature
To use this main tool you need to know either WordPress(WP) username or associated email address.
If so, go to your login page (example:
http://hostpulse-demo.com/wp-admin) and click on Lost your password? Link.
On the next screen enter your username or email and click Get New Password button:
Login your admin mail box and click the link in the email:
Copy the suggested password or enter your own and click the Reset Password button:
Login with your updated password.
Using PHP Function
You can reset your WP Password by adding a built-in wordpress PHP function
functions.php is a vital part of every WP theme.
You can access it through the CPanel's file manager.
Navigate to WP folder > wp-content > themes > 'active-theme' (twentyseventeen in the example).
functions.php file and click on Edit icon and add this code to it, right at the beginning, after the first
wp_set_password( 'password-string', 1 );
(be careful to not delete single quotes around the password, replace password-string with your actual password, something way more secure like
If you were loged in your current session will be destroyed and you have to log in again with the new password.
Upon successful login go back and remove only the added code.
You can access
functions.php file also through FTP.
Login to your FTP account, navigate to the active WP theme files and download
functions.php on your computer.
Open it with your code editor, add the same above function, save the file and upload it back to the server.
After successful login with the new password do not forget to download again
functions.php, to remove the added code and to upload the file back.
Using the Emergency Password Reset Script
To use emergency script you must know the administrator username. The script will update the administrator password and will send email to the administrator's email address.
Follow the next steps to reset your password with the emergency script:
- Open CPanel's file manager and navigate to WP root folder (the same directory that contains
- Create new empty file
- Copy the emergency script from Emergency Password Script and paste it into emergency.php
http://hostpulse-demo.com/emergency.phpin your browser
- Enter the administrator username and the new password, then click Update Options. A new message is displayed to confirm the password is changed. An email is sent to the blog administrator with the changed password information.
emergency.phpfrom your server.
This script is intended to be used as a last resort by WordPress administrators that are unable to access the database. Usage of this script requires that you know the Administrator's user name for the WordPress install.
Using phpMyAdmin to reset WP password is considered more advanced (and more risky also) in comparison with other methods described here.
But if you follow the example you'll see there is nothing so complicated to be scared of.
We strongly recommend before making significant changes on your WP site (always) to export an archive of your database on your computer.
With such archive if something goes wrong you just select and drop all database tables (not database itself) and import the archive to recover everything the way it was before.
From your CPanel open phpMyAdmin and click on the WP database name. If you are not sure which database is the correct one check
hstpls_users table (your table prefix surely is different then mine, so you look for
Click on Edit icon:
Find user_pass row and delete the encrypted string:
Replace newpassword with your password and from the dropdown menu select MD5 encryption method:
Check that your password is correct and that MD5 is in the box.
Click Go button.
Test the new password on the login screen.
Of course these are not all possible ways to reset WP password but the described above 5 ways are strong guarantee you'll never be unable to log in your WordPress site.
#wordpress #security #password