Forked from andrewlimaza/redirect-users-after-logout-wordpress.php
Created
February 20, 2026 10:01
-
-
Save JarrydLong/a178ea2a5259f85c4301d101c0c0d320 to your computer and use it in GitHub Desktop.
Redirect users after logout WordPress
This file contains hidden or 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 login page after logging out of WordPress. | |
| */ | |
| function my_redirect_after_logout_wp(){ | |
| wp_redirect( "/login" ); | |
| 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