Skip to content

Instantly share code, notes, and snippets.

@getmanzooronline
Created January 5, 2021 03:39
Show Gist options
  • Save getmanzooronline/ac5ca3cec72b02f1feb40dd73530e329 to your computer and use it in GitHub Desktop.
Save getmanzooronline/ac5ca3cec72b02f1feb40dd73530e329 to your computer and use it in GitHub Desktop.
Redirect default WordPress Registration and Login pages.
// Redirect Registration / Login Page
function pro_registration_page_redirect()
{
global $pagenow;
if ( ( strtolower($pagenow) == 'wp-login.php') && ( strtolower( $_GET['action']) == 'register' ) ) {
wp_redirect( home_url('/registration'));
}
if ( ( strtolower($pagenow) == 'wp-login.php') ) {
wp_redirect( home_url('/my-account'));
}
}
add_filter( 'init', 'pro_registration_page_redirect' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment