add_filter('comment_post_redirect', 'redirect_after_comment'); function redirect_after_comment($location) { return $_SERVER["HTTP_REFERER"]; }