wordpress snippets last updated   : July 14, 2014
we now have 634 snippets

Redirect commenter to thank you post or page

wordpress snippet

Why not thank your visitors! Let them know they are important by redirecting them to a thank you page where you can display a great big thank you for commenting on my wordpress site message. Adding this snippet to the functions.php of your wordpress theme will redirect a commenter to any post or page you specify. To update the snippet to a page change wp_redirect('/page/'); replace /page/ with whatever page you would like eg: wp_redirect('/thank-you/');.

snippet :  PHPcopy
add_filter('comment_post_redirect', 'redirect_after_comment');
function redirect_after_comment(){
      wp_redirect('/page/');
      exit();
}

jqsnipp.com | we just launched jquery snippets website