Modify the admin access in WordPress

I’ve been super busy recently so here is just a short update of how to change the wp-admin URL in WP.

Since the wp-admin is the same for every WP site, you might want to change the login URL so that some malicious attacks or attemps could be avoided.

Add the following code to the functions.php file in either your server (wp-content/themes/*themename*) or in WP admin Appearance-Theme Editor

#redirect to the 404 page when the url does not match the given string.
#url/wp-login.php?login=*string*

add_action('login_enqueue_scripts','login_protection'); 
    function login_protection(){ 
      if($_GET['login'] != '*string*')header('Location: https://theparnassus.xyz/404'); 
    }

Leave a Reply

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