• Right now after a user logs in they are taken to the user end of the dashboard. I want them to be redirected to the homepage instead after log in. I found a plugin that does this but it seems to be overkill to install an entire plugin just for this little task when I can probably just edit a simple line in one of the core files. Does anyone know which file this is and what exactly I have to do??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try adding this to your theme’s functions.php file…

    /* redirect users to front page after login */
    function redirect_to_front_page() {
    global $redirect_to;
    if (!isset($_GET['redirect_to'])) {
    $redirect_to = get_option('siteurl');
    }
    }
    add_action('login_form', 'redirect_to_front_page');

    This is great, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I redirect users to the front page after log in?’ is closed to new replies.