wordpress snippets last updated   : January 29, 2015
we now have 646 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(){

Did you like this post? If so please share it with your friends. Thanks!