Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save michaelbeil/dd481da59f9d550f08398bfd8f91136f to your computer and use it in GitHub Desktop.
Save michaelbeil/dd481da59f9d550f08398bfd8f91136f to your computer and use it in GitHub Desktop.
Redirect users to home page after logging out of WordPress
<?php
/**
* Redirect users to home page after logging out of WordPress.
*/
function my_redirect_after_logout_wp(){
wp_redirect( home_url() );
exit;
}
add_action('wp_logout','my_redirect_after_logout_wp');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment