in WordPress

Redirect Wordpress Commenters To A Thank You Page

If you have your own blog you will know important it is to have people comment on it. There are many things you can do to encourage people to comment on your blog. You can have do follow links in your post so that the commenter will get a link back to there websites as a thank you for the comment. But why not actually say thank you to people who comment on your blog, this can be done by redirecting your commenter to a thank you page you make in Wordpress. Here is a Wordpress snippet to add to your functions.php page which will redirect the commenter to a thank you page.


add_filter('comment_post_redirect', 'redirect_to_thank_you_page');
function redirect_to_thank_you_page(){
      wp_redirect('/thank-you-for-your-comment');
      exit();
}

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email