Excellent software and practical tutorials
The user login entrance and administrator login entrance of WordPress are both on the same login page, which may cause some security concerns. Now let's block the default login page and backend management directory of WordPress.
The premise is that you have installed other user login plug-ins, otherwise other users will not be able to log in to the website.
Find the functions.php configuration file in the theme directory, copy and modify the following code
[cc lang="php"]
function login_protection(){
if($_GET['uzbox'] != 'uzbox')header('Location: https://uzbox.com');
}
add_action('login_enqueue_scripts','login_protection');
/*** Hide WordPress login entry
* For more WordPress tips, please visit: https://uzbox.com
* Please keep the source when reprinting, thank you for your cooperation!
**/
Change the uzbox in the above code to your custom name. After the modification, when you access wp-login.php and wp-admin backend directory, it will automatically jump to the website page set above.
So how does the administrator access the management page above?
Just add ?uzbox=uzbox after the wp-login.php file to access it, for example:
/wp-login.php?uzbox=uzbox
There is also a method that does not require modifying the theme, but directly modifying the wp-login.php file.
Open the wp-login.php file in the root directory of the website. You can edit it using Notepad or VI in Linux.
[cc lang="php"]
function login_protection(){
if($_GET['uzbox'] != 'uzbox')header('Location: https://uzbox.com');
Both methods can be used in actual testing. If you have any questions, please leave a message in the comment section below!