Redirect Login Page


  • percyrameetse
    Newbie 1 points
    March 20, 2020 at 4:20 pm

    Hi guys,

    when I log into my site, I would like it to redirect to a different site.

    Please advise on how I go about doing it.

  • JamesD
    JamesD
    Super Guru 1,498 points
    March 22, 2020 at 6:09 am

    Hello,

    Try adding this near the bottom of the _functions.php file in your child theme directory:

    add_action( 'wp_login', function() {
        $sURL = 'https://YOUR_DOMAIN.com/';
        wp_redirect($sURL);
        exit;
    } );

    Note: Replace the YOUR_DOMAIN.com with your URL first.

  • Adnan
    Adnan
    Elite Member 527 points
    March 22, 2020 at 6:52 pm

    If you want the user to be logged in automatically to the other website, you should consider to build a wordpress multisite.

Viewing 3 posts - 1 through 3 (of 3 total)

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes