Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewlimaza/3bc8a41feed5de1cf2a482e23069e923 to your computer and use it in GitHub Desktop.
Save andrewlimaza/3bc8a41feed5de1cf2a482e23069e923 to your computer and use it in GitHub Desktop.
Redirect users after logout 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