Forked from andrewlimaza/redirect-users-after-logout-wordpress.php
Last active
November 10, 2021 14:45
-
-
Save michaelbeil/dd481da59f9d550f08398bfd8f91136f to your computer and use it in GitHub Desktop.
Redirect users to home page after logging out of WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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