• Hello forumers,

    I would like to change url of redirections of login and logout action. In which file can I do it. Tried some ways which did not work.

    Thanks in advence.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You will need to hook into the login_redirect filter.

    Thread Starter Dchidell

    (@dchidell)

    But wasn’t the redirection placed in wp-login.php?

    >But wasn't the redirection placed in wp-login.php?

    — yes, but you shouldn’t edit core WordPress files, especially since there is a hook that you can use instead.

    Your code should look something like:

    add_filter('login_redirect', 'my_login_redirect_function');
    function my_login_redirect_function($redirec_to) {
        // add code here to determine where to redirect the the user after login
    
        return $redirect_to;
    }

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

The topic ‘Login/Logout Redirect’ is closed to new replies.