Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Redirect WordPress Logout to Home Page
//* Redirect WordPress Logout to Home Page
add_action('wp_logout',create_function('','wp_redirect(home_url());exit();'));
@mdahlke

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Dec 4, 2016

Thank you, it's helpful.

@vitaliikaplia

This comment has been minimized.

Copy link

commented Feb 5, 2017

Thanks! :)

@wkille

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.