Redirect users on logout

Have multisite set up and would like to redirect users on logout to the root site home page. I know there has to be an answer for this. But I can’t find it! driving me batty;-) Any help greatly appreciated.

3 Answers
3

you can use wp_logout_url( $redirect); as Pippin sugested if you are echoing out the logout link and if you need it for the built-in logout link on the backend you can use:

//function to redirect after logout
function logout_redirect765(){
  wp_redirect( home_url() ); 
  exit; 
}

//hook function  to wp_logout action
add_action('wp_logout','logout_redirect765');

Leave a Comment