Redirecting logged in user from wp-login.php to home page

Just drop this in your functions.php:

function redirect_to_homepage() { 
    global $redirect_to;
    if (!isset($_GET['redirect_to'])) {
        $redirect_to = get_option('siteurl');
    }
}
add_action('login_form', 'redirect_to_homepage');


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *