Table of Contents
There is no exaggeration in forgetting your WordPress blog/website login passwords. If you found yourself in that situation and looking for ways to restore your WordPress password then you are in the right place.
Make sure that you have access to at least one of the sources like admin email account or hosting account or FTP access or PHPMyadmin panel to restore WordPress password.
Here I am providing the ways you can restore the WordPress admin password.
The very first thing and easiest way to restore the WordPress password is using theme files. I know most of you say forgot password method is easy way. If you are comfortable with that method then it’s awesome you can use that method.
So let’s see how you can restore the WordPress password using theme files.
All you need to do is simply login to your hosting account and open the site folder in the file manager.
Now navigate to wp-content/themes folder.
Open the folder of the active theme on your website.
i.e. wp-content/themes/yourtheme
Now open functions.php file then click on edit.
Paste the following code at the bottom of the functions.php file.
function admin_account(){ $user = 'Username'; $pass = 'Password'; $email = 'email@domain.com'; if ( !username_exists( $user ) && !email_exists( $email ) ) { $user_id = wp_create_user( $user, $pass, $email ); $user = new WP_User( $user_id ); $user->set_role( 'administrator' ); } } add_action('init','admin_account');
Now change Username with the username you want to put as a new username. Add a password in Password place. add the email you are using in place of email@domain.com.
That’s it you are done with creating new permanent user name and password.
Yes, Those details cannot be edited without modifying in the functions.php file. That was awesome right.
It is the most commonly used method to restore the WordPress password. Just click on Lost Password? from the WordPress login page.
Enter Email Id or Username and click on Get New Password button.
Now you’ll receive an email with the link to reset the password. Just open the link enter a new password.
That’s it you are good to go now.
Note: Please note that sometimes it takes some time to receive new reset password link to your email id. It depends on the hosting speed you are using.
If you don’t have access to your email id or if you are not getting reset link to your email you can use this method to manually change the login password.
The very first thing you need for this is cPanel or web hosting or PHPMyAdmin login details to log in to PHPMyAdmin.
If you don’t know the exact database name of your website you can find it in wp-config.php file located in the root folder of the website.
Once you open the wp-config.php file scroll down to /** MySQL database username */ to find the name of your database.
Note: Make sure to change password to a new password or create a new admin account to secure the password.
Most of the time your web host uses the Installatron to install any app like WordPress or phpBB etc. with just one click. This is also called a one-click installation wizard. If your host is using the Installatron you can easily reset the WordPress admin password without going to into all the details mentioned above.
Here you just need to find the tab in your cPanel for One-click installation apps. Then click on WordPress as shown in the image.
Now scroll down to the WordPress website that you want to change the password for then click on edit pencil icon. Now scroll down to Admin Account section. Here change the admin password and save settings.
This is also an easy way to reset the admin account password if your hosting provider using the Installatron.
Conclusion: Hope these methods will help you to reset your WordPress admin password. If you know any of the other methods please send us via comments.