Reset WordPress password

Source: Internet
Author: User
Tags wordpress database
1. reinstall WordPress. We do not recommend this method. it is troublesome to reinstall and download the installation file. 2. use the password retrieval function. WordPress supports email password retrieval. if the email of the administrator account is valid, click "forgot password?" on the background logon page ?" Link, enter the correct email address, you will receive a password reset 1, reinstall WordPress. We do not recommend this method. it is troublesome to reinstall and download the installation file.

2. use the password retrieval function. WordPress supports email password retrieval. if the email of the administrator account is valid, click "forgot password?" on the background logon page ?" Link. enter the correct email address and you will receive an email containing the reset password.

3. delete the wp-config.php file under the WP directory, and then visit the website again, which will let you re-execute the last installation step, so that you can get a new password.

4. log on to phpMyAdmin and find the wp_users table of the WP database. here we can see the default user admin, whose password is encrypted. At this time, we can modify this data, find the user_pass domain, delete its original long string of data, and write your password, such as 123456. In this case, you will see a function drop-down box and select it as MD5. This is to encrypt your password using the MD5 algorithm and then save it. In this way, access the management portal through your domain name/wp-admin and use this password to log on.

5. use an SQL statement to change the password. Log on to phpMyAdmin and go to the WordPress database and run the following SQL statement:
UPDATE wp_users "sh_keyword"> SET user_pass "sh_symbol"> = MD5 "sh_symbol"> ('password') WHERE wp_users.user_login = 'admin' LIMIT; UPDATE wp_users SET user_pass = MD5 ('password') WHERE wp_users.user_login = 'admin' LIMIT 1;

6. use PHP to retrieve the password. The PHP method is also used to modify SQL query statements, but provides a user interface. Copy and save the following code as a password-resetter.php file, upload it to the WordPress root directory, run the file, and enter the password to reset it.
// Password resetter
Include ("wp-config.php ");
Include ("wp-blog-header.php ");
If (empty ($ _ POST ['emergency _ pass']) {
?>

Set admin password:
 
Form>


} Else {
$ SQL = "UPDATE ". $ wpdb-> users. "SET user_pass = '". md5 ($ _ POST ['ergency _ pass']). "'Where User_login = 'admin '";
$ Link = $ wpdb-> query ($ SQL );
Wp_redirect ('WP-login. php ');
Exit ();
}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.