4 comments

  1. This code adapted from: Registration Redirect

    add_filter( 'registration_redirect', 'ckc_registration_redirect' );
    function ckc_registration_redirect() {
        return home_url();
    }
    

    This code adapted from: Login Redirect

    add_filter( 'login_redirect', 'ckc_login_redirect' );
    function ckc_login_redirect() {
        // Change this to the url to Updates page.
        return home_url( '/Updates' );
    }
    

    Add the code to the functions.php theme (or child theme) file.

  2. To add one more to the list for logout:

    add_action('wp_logout','go_home');
    function go_home(){
      wp_redirect( home_url() );
      exit();
    }
    
  3. To globally redirect after successful login, find this code in wp-login.php, under <form name="loginform"> section.

    <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
    

    and replace <?php echo esc_attr($redirect_to); ?> with your URL where you want to redirect. The URL must start with http:// and ends on /other wise page redirect to default location.

    Do same thing form redirect after registration with in same file but under <form name="registerform"> section.


    Edit:

    This method involves changing WordPress core code. It is rarely recommended by any serious WordPress programmer. Proceed at your own risk.

Comments are closed.