👋🏼Welcome to my WP-Host blog where I am excited to share my knowledge and expertise on WordPress hosting and website construction tutorials with you. Let’s connect and learn from each other! You can reach me at info@yrshare.com.

(如果你会中文,可以点击微信图标与我联系。)

扫一扫加我

注:因个人英文水平有限,所以暂时只能为懂中文的朋友提供wordpress建站服务

微信:18200592859 或 yrwordpress

Disable Admin Username for WordPress (To Make Your Website More Secure)

Disable Admin Username for WordPress: This simple WordPress tutorials will show you how to disable the admin username for your website, which can improve the security of your WordPress site. If you are currently using admin or any other similar simple usernames, it is highly recommended that you refer to this tutorial and make the necessary changes.

【WP-Host/悦然wordpress建站】
Disable Admin Username for WordPress (To Make Your Website More Secure)-WP-Host

Keep sharing wordpress tutorials. So far, many websites still use admin as the default user name of the website, which is very detrimental to the security of the website. Just like the password 123456, the admin user name is also very easy to be used by hackers, so【WP-Host/悦然wordpress建站】It is recommended that you do not use the default admin as the user name.

Disable Admin Username for WordPress (To Make Your Website More Secure)-WP-Host

If your current website is using admin as the user name, it is best to log in to the wordpress site building background immediately, then add a new administrator user, set a more complicated user name, and then delete the admin user.

There are also some bad guys who may use tools to scan your wordpress background, and this scanning tool usually uses the admin username to try to log in to the background, which will also affect the website, so we can further ban the admin username.

add_filter( ‘wp_authenticate’, ‘fanly_no_admin_user’ );function
fanly_no_admin_user($user){
if($user == ‘admin’){
exit;    }
}
add_filter(‘sanitize_user’, ‘fanly_sanitize_user_no_admin’,10,3);function fanly_sanitize_user_no_admin($username, $raw_username, $strict){
if($raw_username == ‘admin’ || $username == ‘admin’){
exit;    }
return $username;}

To implement this, open the functions.php file for the current WordPress theme and add the above code to it. Save the changes to make it effective.

Alternatively, you can use the Code Snippets plugin to add the code to your website, which can be more convenient. For instructions on how to download and use the plugin, please refer to the above article.

Tips: If you’re using any other website construction program, it is recommended to avoid using “admin” as the username for better security.

Disable Admin Username for WordPress (To Make Your Website More Secure)-WP-Host

继续分享wordpress建站教程。到目前为止,依然有很多网站在使用admin作为网站的默认用户名,这对网站安全来说是非常不利的,就跟123456这样的密码一样,admin用户名也是非常容易被黑客利用的,所以【WP-Host/悦然wordpress建站】建议大家不要使用默认的admin作为用户名。

Disable Admin Username for WordPress (To Make Your Website More Secure)-WP-Host

如果你目前的网站正在使用admin为用户名,那么最好马上登陆wordpress建站后台,然后添加一个新的管理员用户,设置一个复杂一点的用户名,然后再删除admin这个用户。

还有一些坏人可能会使用工具扫描你的wordpress后台,而这种扫描工具一般都会使用admin用户名来尝试登陆后台,这样对网站也是有影响的,所以我们还可以进一步把admin用户名禁止。

add_filter( ‘wp_authenticate’, ‘fanly_no_admin_user’ );function
fanly_no_admin_user($user){
if($user == ‘admin’){
exit;    }
}
add_filter(‘sanitize_user’, ‘fanly_sanitize_user_no_admin’,10,3);function fanly_sanitize_user_no_admin($username, $raw_username, $strict){
if($raw_username == ‘admin’ || $username == ‘admin’){
exit;    }
return $username;}

打开当前wordpress建站主题的functions.php文件,然后把上面的代码添加进去,保存即可生效。

另外我们也可以使用Code Snippets插件,把上面的代码添加到插件中,这样会更方便,插件下载及使用可以参考上面的文章。

tips:如果你的网站使用的是其它建站程序,同样不要使用和admin作为用户名哦。

WordPress Hosting / 悦然wordpress建站

WordPress Hosting / 悦然wordpress建站

【WordPress Hosting / 悦然wordpress建站】I am a WordPress hobby from China, and I like to communicate with friends from all over the world to learn WordPress website building and maintenance related knowledge.