WordPress is not allowed to use the admin user name to log in to the account

Remember that when the previous version of WordPress program is installed by default, the user name will use admin by default, but now when the new version of the installation site, you can set a non admin user name. In view of security considerations, if you use the admin user name, some software will automatically scan the account. In view of this problem, we can use the following methods to solve this problem.

1. Re create a new account

We can create a new user name in the WP background and authorize the administrator role.

2. You can delete the admin user name

Of course, you need to transfer the published articles to the new account created.

3. Forbid the login of admin user with script

add_ filter( ‘wp_ authenticate’, ‘itbulu_ no_ admin_ user’ );
function itbulu_ no_ admin_ user($user){
if($user == ‘admin’){
exit;
}
}

add_ filter(‘sanitize_ user’, ‘itbulu_ sanitize_ user_ no_ admin’,10,3);
function itbulu_ sanitize_ user_ no_ admin($username, $raw_ username, $strict){
if($raw_ username == ‘admin’ || $username == ‘admin’){
exit;
}
return $username;
}

Drop the code to the Functions.php File.

Related Article
WordPress automatically intercepts part of the content of the article as a summary

In the daily release of articles, not every article may have an article summary, so the summary function of WordPress Read more

Implementation of tag inner chain association effect of WordPress program without plug-in

Nowadays, whether it is a large website or a personal blog, what matters is not the weight of the website Read more

Is in WordPress Theme_ Home () and is_ front_ Different usage of page ()

Under normal circumstances, when we use WordPress to build a website, the home page is the default index.php Just call Read more

How to delete the version number tail of WordPress scripts and CSS style sheets

As an excellent website building program, WordPress is undoubtedly the largest user group in the world in terms of user Read more

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image