Redirect user after submitting a comment:

Redirect user after submitting a comment:

  1. Open functions.php file
  2. Copy and paste this code in the file:
  3. Change the name of the page on the 2nd line
  4. Save changes
function redirect_after_comment(){
wp_redirect('/thank-you/');
exit();
}
add_filter('comment_post_redirect', 'redirect_after_comment');

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Do NOT follow this link or you will be banned from the site!
%d bloggers like this: