Add the following code to the bottom of your active theme’s functions.php file to redirect users to the homepage. You can add custom URL slug inside home_url
function to redirect to a custom URL.
add_action('wp_logout', 'wpdm_logout_redirect');
function wpdm_logout_redirect(){
wp_redirect(home_url(""));
exit();
}