In this post
- Password recovery feature
- phpMyAdmin
- FTP Account
- PHP Script
If you forget your admin password, follow these steps to recover WordPress admin password!
In this post
Method 1. Use the password recovery feature
Only applies when hosting does not turn off the mail function. If hosting is turned off, you will not receive a recovery email.
So, if you do not receive the email, ask the hosting provider to turn it on.
Visit the wordpress login page under the link: example.com/wp-admin or wpcodeless.com/wp-login.php
with: example.com is your domain name
Click Lost your password?
Enter your username or email address and click Get New Password.
Check your email
Only applies when hosting does not turn off the mail function. If hosting is turned off, you will not receive a recovery email.
So, if you do not receive the email, ask the hosting provider to turn it on.
Method 2. Create a new password in phpMyAdmin
If you have a hosting account, sign in.
Find Databases and click on phpMyAdmin
Select the Database of your website, and look for the WP_USERS line
Find your username, and select Edit
In field 1, type your new password. In field 2, select MD5
Click Go
Done
Method 3. Create new password with FTP Account
If you do not have a Hosting account, only FTP account, you can do the following:
Open File Zilla, download File Zilla at: https://filezilla-project.org/download.php?type=client
Find the functions.php file at wp-content/themes/your-theme/functions.php
Insert the following code at the end of functions.php
wp_set_password( ‘abcxyz@33498’, 1 );
with abcxyz@33498 is your new password, and 1 is your admin account ID.
Try signing in again. If successful, remove the code above.
If you login error. Please delete the above code and log back in
Method 4. Use PHP Script
Create a file long.php in the website directory with the following content:
Content in this link: https://gist.github.com/khunglongwp/86bb3a99c94ea5f7716a240ef5e72d88
Open link: example.com/long.php
with example.com is your domain name.
Enter Username and New Password
Try signing in with this new password. If successful, delete the long.php file to prevent others from changing your password ^^