Disable WP Login PHP Code
Paste code at the bottom of functions.php to disable WordPress login.
// Disable wp login
function custom_login_page() {
$new_login_page_url = home_url( '/login/' ); // new login page
global $pagenow;
if( $pagenow == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') {
wp_redirect($new_login_page_url);
exit;
}
}
if(!is_user_logged_in()){
add_action('init','custom_login_page');
}