Last active
August 2, 2023 12:52
-
-
Save texe/dac667b13b996d2708230a43cd2dec78 to your computer and use it in GitHub Desktop.
WordPress - Redirect to home page after login/logout in 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
// redirect to home after login/logout | |
add_action('wp_logout','go_home'); | |
function go_home(){ | |
wp_redirect( home_url() ); | |
exit(); | |
} | |
add_action('wp_login','go_home_after_login'); | |
function go_home_after_login(){ | |
wp_redirect( home_url() ); | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment