Wordpress Forgot Background Password How to Retrieve Password

Many friends are using the wordpress open source system to build websites, but they may forget the background password when using it. I have also forgotten it, mainly because there are too many passwords, and the memory is confused. Haha, the following is what I wrote about wordpress password recovery Method, share with everyone
This method is based on the program code, simple and easy to use, this method is to generate a super administrator account through my code, so that you can enter the WordPress management background, the specific steps are as follows
* *Step 1:** Log in through your FTP account, or log in to the server through the pagoda system, find the root directory of the current wordpress system site, and create a file named niu.php in the root directory. Please note that the file extension must be php

**Step 2:** Copy the following code into the niu.php file


```php
<?php
include 'wp-config.php';
$user_login = 'litieniu';//这个是新加的管理员账户
$user_pass  = '123456';//这个是新管理员密码
$user_email = '12345678ee@not_exists.com';//这个邮箱不用管
$role       = 'administrator';
$userdata   = compact('user_login', 'user_email', 'user_pass','role');
$user_id    = wp_insert_user($userdata);
print_R($user_id);
其中:litieniu是管理员账户名,123456是密码

**步骤三:**运行这个文件,例如你的网站是www..com,那么网站你在浏览器地址栏里输入:www.xxx.com/niu.php,程序就会执行新建管理员命令,并且页面会返回一个数字。例如你的wordpress网站只有一个管理员,那么程序会默认返回2这个数字,总之,返回的是个数字就说明添加管理员成功了

**步骤四:**进入管理地址登陆界面,输入刚刚新建的用户名和密码就可以进去了

**步骤五:**进入系统管理中心后,找到【用户】列表链接,修改一下你之前的那个管理员密码,那么之前的那个管理员就可以登陆了
然后这里要提醒你的是,请把刚刚新增的管理员账户删掉,或者修改一下这个新增的管理员密码,因为默认密码设置的123456太简单,容易出问题,所以建议是删掉这个新管理员,以防被人猜解到破坏系统

以上就是关于找回wordpress后台管理员密码的方法,分享完毕。

Guess you like

Origin blog.csdn.net/venus150/article/details/124838279
Recommended