Redirect users on logout

you can use wp_logout_url( $redirect); as Pippin sugested if you are echoing out the logout link and if you need it for the built-in logout link on the backend you can use:

//function to redirect after logout
function logout_redirect765(){
  wp_redirect( home_url() ); 
  exit; 
}

//hook function  to wp_logout action
add_action('wp_logout','logout_redirect765');

error code: 523