Redirect WordPress Login / Register

Sourced here.

add_action('init','possibly_redirect');



function possibly_redirect(){

 global $pagenow;

 if( 'wp-login.php' == $pagenow ) {

  wp_redirect('http://google.com/');

  exit();

 }

}

Alternatively, you can link to a WordPress page ID:

add_action('init','possibly_redirect');



function possibly_redirect(){

 global $pagenow;

 if( 'wp-login.php' == $pagenow ) {

  wp_redirect(get_permalink(2));

  exit();

 }

}

 

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.