WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

You answered a logout redirect question for this guy a while ago, I implemented the code and it worked great, thanks! (http://wordpress.org/support/topic/wp-logout-page-redirect-to-homepage)

My follow up question is how you would format that code to specify a unique URL if it wasn't the home page?

share|improve this question
Welcome to WPSE. What kind of landing page do you have in mind: post, page, archive, external webpage, ... ? – birgire May 6 '14 at 21:29
Who is "You"? Please read the faq to see what this site is about. Thanks. – kaiser May 6 '14 at 22:03

It looks like you're addressing me ;-)

If you want to modify this code snippet:

add_action( 'wp_logout','go_home' );

function go_home(){
  wp_redirect( home_url() );

you can replace the home_url() part with your custom page URL:


but I wouldn't recommend hardcoding the landing page, if it's an internal page.

You can try to construct the landing page with various WordPress functions:

You have for example get_permalink() and extra input parameters to home_url(). Then there's get_category_link(), get_tag_link(), get_post_type_archive_link(), ... etc.

If you explain what kind of landing page you have in mind (page, post, archive, custom, external) then I can expand it further.

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.