Redirect comment author after posting

Redirect your comment author when his comment is submitted. Create a thank you page or whatever you have in mind and adjust the wp_redirect url using the slug of the page. You can i.e. create a bonus page to encourage your site’s comment activitiy and give rewards special offers.

/**
 * Snippet Name: Redirect comment author after posting
 * Snippet URL: https://www.wpcustoms.net/snippets/redirect-comment-author-posting/
 */
  function wpc_redirect_after_comment(){
      wp_redirect('/thank-you/');
      exit();
}
add_filter('comment_post_redirect', 'wpc_redirect_after_comment'); 

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x