Forgot wordpress password? – Reset it using cpanel and phpmyadmin

Forgot wordpress password? – Reset it using cpanel and phpmyadmin

What to do if you forgot wordpress password and are unable to login to your dashboard? This is a situation of worry for you as in such a case, you will not be able to check your website’s dashboard and will not be able to see any stats or add any new post.

We will let you know here different methods by which you can recover the forgotten wordpress password and then can reset it.

How to reset WordPress Admin Password

Follow the mentioned methods in the sequence as we have mentioned them sequentially in the order of simplest to toughest. You can try any of them.

Recover wordpress password using email

This is the simplest trick of getting your credentials back.

1. Go to the url

2. Click on Lost your password?


3. On the next page, you need to enter your emailid (for which you need to reset the password) and click on the button Get new password.


4. Check your emailbox. You will get an email from WordPress, with below contents:
Someone has requested a password reset for the following account:
Site Name:
Username: youruser
If this was a mistake, just ignore this email and nothing will happen.
To reset your password, visit the following address.


5. Click on the link.

6. Enter your desired new password and click on Reset Password button.


7. Make sure you enter correct email id. If your email itself is not registered then you will get a message on screen as There is no user registered with that email address.

Get new password
No user registered with email

8. Some of the webhosts do not support the mail() function and so, you will not be able to recover forgotten wordpress password with this simple trick. So you should always have your website on some good webhost such as A2Hosting or BlueHost.

9. Anyways, if your hosting company is not supporting mail() function and you are seeing below error then you need to try our other methods listed below.
The email could not be sent.
Possible reason: your host may have disabled the mail() function.

Email not sent wordpress
Your host disabled mail function

Reset wordpress admin password using cPanel

In this method, you will learn to how to recover forgotten wordpress password using cpanel.

1. Login to your website cpanel. You can either go to your web host’s cpanel url or can login via any FTP tool such as Filezilla.

2. Go inside directory public_html/wp-content/themes/your_theme_name.

3. Download file functions.php on your local hard disk.

Forgot wordpress password cpanel
functions.php file

4. Paste below code in functions.php file, just after opening php tag. Refer the image below.

wp_set_password( 'abcz', 1 ); 
Reset password in cpanel

5. Please note that in above code, you can see 2 values – one is abcz and second is integer 1. The string abcz is the new password that you want to update and numeric 1 is the id of user for which you forgot wordpress password and for which you want to reset it.

6. In order to get the id of the user, you have to login to your cpanel and then go inside phpmyadmin.

phpmyadmin in cpanel
phpmyadmin in cpanel

7. Click on your blog’s database.

8. You will see plenty of tables there. You need to select wp_users table.

Reset password wp_users
wp_users wordpress table

9. Check the id corresponding to your required username. See in below picture, we have highlighted the id of the user in yellow color.

lost wordpress password
edit userid password

10. After editing the above code with correct id, upload functions.php file back to your theme directory.

11. Head over to url and try login with the user and new credential.

12. If it works then voila, you are done. And if it does not then head over to below other methods.

13. Whether this trick worked or not, you have to remove the code that you have added in functions php file.

14. So remove the code that you added in Step number 4 and using ftp, re-upload the functions file back to the theme directory.

Reset wordpress admin password using phpmyadmin

In the above trick, we have showed you to get the required id of user for which we need to reset the credentials. In this method, we will let you know to how to get wordpress username and password from database using phpmyadmin and MD5.

1. Login to phpmyadmin.

2. Select the required database. You can check the database that your website is using in wp-config.php file.

3. See below code snippet from wp-config file which tells us that the site is using ‘testBloggerPngDb’ database.

define('DB_NAME', 'testBloggerPngDb'); 

4. Select the table by the name wp_users.

5. Select the corresponding user for which you forgot wordpress password.

6. Click on ‘Edit’.

Reset password md5
Edit wp_users id password

7. Corresponding to user_pass column, select MD5.

8. Change the new password. For demonstration purposes, we have entered ‘myNewPwd’.


9. Click on Go button.

Go button Phpmyadmin
Go button

10. Try login to your website wp dashboard. You should be able to login.

11. Voila, you are done and the issue is resolved.

You will wonder that the old password was saved in an encrypted form and with this MD5 hashing technique, you have overridden the encryption.

Actually, MD5 is an old hashing technique that wordpress used prior to its 2.5 version. But after wordpress 2.5, it has started using some more strong hashing techniques. After changing the password, when you will first login to your dashboard then wordpress will recognize the MD5 and reset wordpress admin password to its latest hashing encryption algorithm. So, you no need to worry on security and encryption of your credentials.

Reset wordpress admin password using WP CLI

WP CLI is the command line tool that helps you in managing the wordpress installation for your blog. I would recommend this to you only if you are expert in linux commands. If you are comfortable with Wp-CLI then head over below to know the commands that you have to use.

1. You need to go to the directory where you have installed wordpress.

2. Enter below command:

wp user list 

3. The screen will show the ids and the usernames.

4. Type below command:

wp user update 12 --user_pass=myNewPwd

5. In the above code-snippet, 12 is the id of username for which you forgot wordpress password and myNewPwd is the new pass.

6. Try login to dashboard now.

Recover wordpress password using Chrome browser

‘Remember Me’ is a feature that saves your passwords in your browser. Many bloggers utilize this feature and save their credentials in their browsers. If you use Chrome and have saved the credentials in it while performing login to your wp dashboard then we are showing you here to how to retrieve those credentials.

1. Open Chrome browser.

2. In the search bar, type chrome://settings/passwords and hit enter key.

3. A below screen will appear which will show you the username and the password corresponding to various websites which you login. Another way to reach this screen is by clicking on Menu icon –> Settings –> Passwords.

Password saved Chrome
Passwords saved in Chrome

4. Click on Eye icon. You can see that Google Chrome is asking you to enter your windows login.

Chrome passwords
Windows login for Chrome passwords

5. Enter your windows login and click Ok.

6. Now, go to the same eye icon and click on it.

7. You will see that Google Chrome is displaying your lost wordpress password.

8. Copy it on your notepad.

9. Login to your dashboard. The login should be successful.

Please note that Chrome updates your credentials every time you check ‘Remember Me’ and types it manually on your chrome browser. So, remember that if you have forgotten your wordpress password then do not check ‘Remember Me’.

Recover wordpress password using Firefox browser

Like Chrome, the ‘Remember Me’ functionality is also available in Firefox. So if you have saved the logins in Firefox then this method can help you in recovering them.

1. Open Firefox browser.

2. In search, type about:preferences#privacy and hit enter on your keyboard.

3. Below screen will appear.

Firefox Privacy Logins
Firefox Privacy Logins

4. To reach above screen, you can also go through Menu –> Options –> Privacy & Security.

Firefox Privacy Security Logins
Firefox Privacy and Security

5. Click on Saved Logins.

6. Go inside Show Passwords.

Show passwords firefox
Show passwords in firefox

7. A popup will appear which will ask you to Are you sure you wish to show your passwords?. Click on yes and confirm.

Confirm passwords firefox
Confirm passwords

8. You will see all your logins at one place.

9. Click on Hide when you have noted the logins on your notepad.

Saved Logins firefox
Saved Login credentials in firefox

10. If you want to remove any particular login credentials then you can click ‘Remove’ and in order to remove all the logins, feel free clicking ‘Remove All’.


As it holds for Chrome, the same holds for Mozilla Firefox as well. Do not use ‘Remember Me’ if you have lost wordpress password.

2 thoughts on “Forgot wordpress password? – Reset it using cpanel and phpmyadmin”

Leave a Comment

%d bloggers like this: