Many webmasters are used to making the browser remember the website's user name and password, so that they do not need to enter the user name and password when logging on again, but over time, they forget the user name and password. We have introduced several methods to retrieve passwords,
Procedure:
I. I did not remember the random password I just installed
Method 1: open the email address entered during installation, and you will receive an email from WordPress containing the account and password of the new blog;
Method 2: delete the wp-config.php file under the WP directory, and then visit the website again, this time will let you re-install the last step, so that you can get a new password;
2. Forget the new password after changing the default password
Method: In the WordPress blog login window, click "forgot password ?", Enter the user name or the email address used for installation, click "Get new password", and view it in the email address;
3. Suddenly forget the password for a while
Method: Log onto phpmyadmin and find the wp_users table of the WP database. The default username admin and password are displayed here. The password can be encrypted, but you can modify this data and find the user_pass field, delete a long string of data and enter a new password, such as boke8net. Then, you can see the bottom border of a function and select MD5 to encrypt the password and save it. Log in with a new password, such as boke8net
Reminder: except for the third case, the methods in other cases are common.
The methods mentioned above have their own drawbacks and are even unavailable. Now, blog will share a simple and practical wordpress password reset code.
Save the following code as the find. Php file and upload it to the root directory of the website:
<? Php
Include ("wp-config.php ");
If (empty ($ _ POST ['resetpwd']) {
?>
<Form method = "post">
Enter the new password:
<Input name = "resetpwd" type = "password"/>
<Input type = "submit" value = "submit"/>
</Form>
<? Php
} Else {
$ SQL = "UPDATE ". $ wpdb-> users. "SET user_pass = '". md5 ($ _ POST ['resetpwd']). "'Where User_login = 'admin '";
$ Link = $ wpdb-> query ($ SQL );
Wp_redirect ('WP-login. Php ');
Exit ();
}
?>
Open http: // domain name/find. php in the browser, enter the new password, and click submit to go to the blog logon page, indicating that the password is successfully reset.
Note: after the password is reset, delete the file to avoid being used by others.