How to retrieve the forgot password for logging on to WordPress

Source: Internet
Author: User
Tags md5 php file wordpress blog wordpress blog login

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.

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.