Skip to content

Instantly share code, notes, and snippets.

@jerrickhakim
Created January 30, 2018 07:18
Show Gist options
  • Save jerrickhakim/39028b7648e0fcb08a0ebacc4c885ded to your computer and use it in GitHub Desktop.
Save jerrickhakim/39028b7648e0fcb08a0ebacc4c885ded to your computer and use it in GitHub Desktop.
Paste this code in the functions.php file in your child theme to choose where you would like your visitor to be redirected after they logout.
/* WORDPRESS REDIRECT ON LOGOUT */
add_action('wp_logout','auto_redirect_after_logout');
function auto_redirect_after_logout(){
wp_redirect( home_url("/login") );
exit();
}
/* END WORDPRESS REDIRECT ON LOGOUT */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment