/** * Redirect to custom page on logout */ add_action( 'wp_logout', 'owp_redirect_after_logout' ); function owp_redirect_after_logout() { wp_redirect( '../blog/' ); exit(); } /** * Redirect to custom page ID on logout */ add_action('wp_logout','auto_redirect_after_logout'); function auto_redirect_after_logout() { wp_redirect( get_permalink(23) ); exit(); } /** * Logout redirect to home page */ function redirect_after_logout($logout_url, $redirect) { return $logout_url . '&redirect_to=' . home_url(); } add_filter('logout_url', 'redirect_after_logout', 10, 2);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter