Change wp-admin url without plugin

Add below function to your "functions.php" file
function changeadmin() {
$stng = '?securelogin';
$geturl = 'http://' . $_SERVER['SERVER_NAME'] . '/' . 'wp-login.php' . '?'. $_SERVER['QUERY_STRING'];
if ( site_url('/wp-login.php').$stng != $geturl ) {
header( 'Location: http://' . $_SERVER['SERVER_NAME'] . '/' );
}
add_action('login_head', 'changeadmin');
Share on Google Plus

About Amit

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment