Skip to content

Instantly share code, notes, and snippets.

@bwhli
Created July 7, 2015 04:54
Show Gist options
  • Select an option

  • Save bwhli/bb63d1330afc9c64df78 to your computer and use it in GitHub Desktop.

Select an option

Save bwhli/bb63d1330afc9c64df78 to your computer and use it in GitHub Desktop.
Redirect WordPress Logout to Home Page
//* Redirect WordPress Logout to Home Page
add_action('wp_logout',create_function('','wp_redirect(home_url());exit();'));
@mdahlke
Copy link
Copy Markdown

mdahlke commented Nov 29, 2016

Just for a more common syntax...

function logout_redirect_home(){
	wp_safe_redirect(home_url());
	exit;
}
add_action('wp_logout', 'logout_redirect_home');

@korrio
Copy link
Copy Markdown

korrio commented Dec 4, 2016

Thank you, it's helpful.

@vitaliikaplia
Copy link
Copy Markdown

Thanks! :)

@wkille
Copy link
Copy Markdown

wkille commented Mar 7, 2017

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment