Add the following code in functions.php within your theme folder for redirect customers into home page after logout in WordPress

add_filter('logout_url', 'new_logout_url', 10, 2);
function new_logout_url($logouturl, $redir)
{
	$redir = get_option('siteurl');
	return $logouturl . '&redirect_to=' . urlencode($redir);
}

Have any doubt, then comment here!

4 Comments on Redirect to home page after logout in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *