If the ways in the previous post can’t help you reset password, then there is a way to reset it directly in your WordPress database using phpMyAdmin. Or you also can do this by editing your functions.php file. In this guide, we will show you how to easily reset password from phpMyAdmin or from functions.php file .
Reset password by editing your database using PhpMyAdmin
This way is for those who have phpMyAdmin. You should only use this method if you’re comfortable with working with databases in this fashion. It’s also recommended that you always back up your database prior to making any database modifications directly.
What is phpMyAdmin ?
It’s a simple, but powerful, application that allows you control over your databases, and can be easily used to change all kinds of information stored in the MySQL databases it manages.
- Login to your site admin panel (e.g: cPanel). Ask your webhost for the login details and link if you do not have them
- In cPanel, scroll down to the databases section and click on PhpMyAdmin.
- Click on Databases to view all databases in your account
- Click on your WordPress databases.
- From the panel list, click on the “user” table. This is usually named “wp_users”, unless you specified a different prefix when installing WordPress. In that case, it will be “yourprefix_users”
- Under user_login you will see the list of registered users. Under the user whose password you wish to reset, click edit.
- Enter your new password in the “users_pass” input box, select md5 from the function dropdown list, and click Go (or perform)
- Test the new password on the login screen.
Congratulations! You have successfully changed your WordPress password using phpMyAdmin.
Reset password by editing functions.php file
There is also an easy way to reset your password via FTP. You need ftp access to use this file.
- Login to your site via FTP
- Go to “…/wp-content/theme/[whichever is your active theme]”
- Open the function.php file
- Edit the file and add this code to it, right at the begging, after the first <?php:Put in your own new password for the main admin user. The “1” is the user ID number in the wp_users table
- Save the file.
- Login to WordPress.
- 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.
And that’s how to reset your WordPress admin password using FTP.
We hope that the solutions covered in this guide were able to get you back in control of your WordPress site. If you have tried any other solutions that worked, please tell us about them in the comments section.
If you are still locked out of our WordPress admin dashboard for any reason. Please follow our next article.