• Resolved manohar8021

    (@manohar8021)


    In This Once User Login its redirecting to Home Page How to Resolve

    i am adding the following Function code..

    How to Set need to redirect to my-account page

    add_filter( ‘user_registration_login_redirect’, ‘ur_redirect_after_login’, 10, 2 );

    function ur_redirect_after_login( $redirect, $user ) {
    return home_url();
    }

    What i need to change here

Viewing 2 replies - 1 through 2 (of 2 total)
  • I too would like to redirect users to the home page once they have logged in. Is that possible?

    Hi @manohar8021,

    The code seems perfectly fine to me. It should work on your site. It’s strange to know that it does not work. Please check whether the code that you pasted in functions.php file is the same as that you have mentioned here.

    And If that does not help then please try this code:

    add_filter( ‘user_registration_login_redirect’, ‘ur_redirect_after_login’, 10, 2 );
    function ur_redirect_after_login( $redirect, $user ) {
    return ‘https://www.yoursite.com’ ;
    }

    Let me know if that helps or not and I will get back to you.
    Regards!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘User Login go to Home Page Instead of Account Page’ is closed to new replies.