WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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() ); 

//hook function  to wp_logout action
share|improve this answer
+1 This will handle logic based redirection – Ashfame May 8 '11 at 14:55

use wp_logout_url( $redirect ); $redirect is the url for them to be redirected to.

share|improve this answer
geeezzz thanks. I had tried that before - but in the wrong spot... worked like a charm! – Ann Jan 31 '11 at 15:05

You can probably accomplish what you need to with wp_logout_url( $redirect ). I'd try replacing the logout link in your theme's template files with something like this:

<a href="<?php echo wp_logout_url( network_home_url() ); ?>" title="Logout">Logout</a>

There's not a codex page for network_home_url(), but there is one for home_url(), and it mentions using network_home_url() for a multisite install.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.