Redirect registration and logic page

5.24K viewsUpdates
1

Hi Rahul,

How do I avoid anspress to follow wp-login.php login page. I have created my own login and registration page. How do I redirect anspress to it

deleted answer

I have a similar issue here. Could hard code it, but would rather do it with a function or hook.

1

@Anup – here you are – please these two functions in your functions.php (child theme)

add_filter( ‘login_url’, ‘change_login_page’, 10, 3 );
function change_login_page( $login_url, $redirect, $force_reauth ) {
return home_url( ‘/login’ . $redirect );
}

add_filter( ‘register_url’, ‘change_register_page’, 10, 3 );
function change_register_page( $login_url, $redirect, $force_reauth ) {
return home_url( ‘/register’ . $redirect );
}

Obviously, change “/login” and “/register” to match the actual URL you want to use

You are viewing 1 out of 2 answers, click here to view all answers.