What to Do If You Forget Your WordPress Username or Password?

Publish: 2014-12-01 | Modify: 2021-01-26

Some friends may forget their usernames or passwords after a long time without logging in to their WordPress website. But there's no need to worry. As long as you have the database access, retrieving the username and password is easy.

One: Forgot Username

Login to phpMyAdmin and find your website's database. Look for the wp_users table and the user_login field contains the usernames. Alternatively, you can execute the following SQL query to see the first 30 usernames.

SELECT * FROM `wp_users` LIMIT 0 , 30;

sqlinfo

sqluser

Two: Forgot Password

  1. The simplest way to recover a forgotten password is to click the "Forgot Password" button on the WordPress login page. You will be asked to enter your username or email (if both are forgotten, use the above method to find them). After submitting, you will receive an email to reset your password. If your host does not support the mail() function and you cannot receive emails, you can use SMTP to send emails.

forgetpass

  1. Use this method if the above method does not work. Login to phpMyAdmin and find the wp_users table. Change the user_pass field to "21232f297a57a5a743894a0e4a801fc3" because WordPress passwords are encrypted with MD5. After the change, the password will be reset to "admin" (remember to change the password after logging in).

user_pass

Update Password Using SQL Query

UPDATE wp_users SET user_pass = '21232f297a57a5a743894a0e4a801fc3' WHERE id = 1;

Note: Change the id to the one you found above. After the update, the password will be admin.


Comments