Change redirect location after users log out
Code snippets should be placed in your functions.php
file or extracted in to your own custom plugin.
add_action('wp_logout','wptd_redirect_after_logout');
function wptd_redirect_after_logout(){
wp_safe_redirect(get_site_url() . '/');
exit();
}
If you want the user to be redirected back to a specific page, such as /login
, change line 3 to:
wp_safe_redirect(get_site_url() . '/login');