How To Redirect First Time Commenters To a Thank You Page in WordPress

Last updated on

One cool feature of WordPress is being able to redirect first time commenters to a custom WordPress page.

Doing so allow the user get to know you and find interesting topics on your website or blog.

This is what I’ve found recently when I made a first time comment in one of Mattew Woodward’s post. I’ve had been redirected to a thank you page.

Here’s how the page looks like.

Matthew Woodward's Thank You Commenting page
Matthew Woodward’s comment redirect in action.

The page design is so simple. But provide great details.

Looks interesting, isn’t it?

In this article, I’ll walk you through how to redirect first time commenters in WordPress like the one you have seen above.

What You Will Learn From This Comment Redirect Guide

  1. How to create a comment redirect page – thank you page
  2. How to redirect first time commenters on WordPress using filter hook
  3. How to redirect first time commenters on WordPress using a plugin

Video Tutorial

First Time Commenters Redirect in WordPress video

If you don’t like the video or need more instructions, then continue reading.

How to create beautiful comment redirect page

The first thing you need to do is create comment redirect page in your WordPress admin area. This can be a thank you page.

You can also redirect users to a landing page or a special offer page. You can decide whether you want it long or short, that would be fine!

Made this page special, you can customize its design to make it looks beautiful.

Here are some tips on creating a comment redirect page to improve user engagement.

  1. Personal Message – In your redirect page, a personal message to the user means a lot.
    Not only it helps them know you better, it is also a way to appreciate one’s ideas/thoughts.
  2. Product or Services – This can be a great area to feature your product and/or services. If you are a web designer or a developer, you’ll want to let them know what you can offer and possibly give them freebies.
    In my case, I am offering a FREE WordPress blog setup to all qualified WPMakeSite users.
  3. Email Opt-in – Using some opt-in boxes or embedding your mailing list. You have to let them know few reasons why they should take this step. Like for example you have to send them relevant resources, tips, and more to keep them coming back to your site.
  4. Social Media – Adding your social media profiles to this page would let them know your social presence. And that they can follow you and add them to your network.
  5. Most Popular Post – Show the commenters some of your most popular posts and let them know that they might like to check them out as well. There’s a good possibility the user haven’t explore your website entirely. Doing so makes the user life easier going to your important pages/posts.

Using a drag & drop page builder WordPress plugin, you can create an awesome page. I highly recommend using Fusion Builder, which comes built-in with the famous and top selling WordPress theme of all time – Avada.

Avada theme live editor

Alternative WordPress page builder plugin

  1. Page Builder by SiteOrigin
  2. Elementor
  3. Beaver Builder

Now, go to your WordPress dashboard and create a new page and name it as thank you for commenting. See this guide on how to create a page in WordPress to learn more.

You might need to include elements that I’ve listed above like a personal message, any product or services, email opt-in box, social media profiles, and your most popular posts.

So how do you redirect first time comments?

Alright, so here’s the fun part of actually redirecting first time comment to the thank you page we’ve just created. In this part, I’ll be discussing two methods: WordPress hook and using a WordPress plugin.

We’ll tackle each – one at a time.

Ready? Let’s go!

Redirect first time comments with a WordPress hook

WordPress offers hooks, a function that can be applied to an Action or a Filter.

These hooks are useful for theme and plugin developers in order to change some default WordPress functionality. In our case, we’re going to modify comment_post_redirect filter.

So, if codes are something you’re comfortable working with, this method is exactly what you need. All you have to do is copy + paste code snippet below and add it to your theme’s functions.php file.

 // Redirect first time commenter on WordPress
 function wpms_redirect_first_time_commenters( $location, $comment ) {

// get count of user comment
 $comment_count = get_comments( array( 'author_email' => $comment->comment_author_email, 'count' => true ) );

// check if it's the user first time comment, then redirect to a "custom" page
 if ( 1 == $comment_count ) {
 $location = '';

return $location;

add_filter( 'comment_post_redirect', 'wpms_redirect_first_time_commenters', 10, 2 );

Note: You MUST change “” to the page URL you wish to redirect first time commenter.

Using the code above, you can redirect first time commenters to thank you page.

But wait, let’s check what exactly each line of code means.

  • Line 2: Declare function wpms_redirect_first_time_commenters() Note: you can name this whatever you want
  • Line 5: Check user had actually leaves a comment
  • Line 8: Check if it’s the user first time comment
  • Line 15: Add the filter

There has to be an easier, way, right?

Yes and for total beginners, I personally don’t recommend this method. Most especially if you’re not so comfortable with writing codes.

An alternative way is to use a plugin called Yoast comment hacks instead.

Install Yoast comments hacks WordPress plugin

The first thing you need to do is install and activate the Yoast Comment Hacks plugin. For more details, see this beginner guide on how to install a WordPress plugin.

Upon activation, go to Settings » Comment Hacks page to configure plugin settings.

This plugin is really great which makes comment management easier. It has four tabs which correspond to its feature. In this tutorial, we’re going to focus on the comment redirect feature.

Clicking this tab allows you to configure another setting.

Since we already have created our redirect page, all you have to do is locate it using the drop-down.

When you are done, click on the Save Changes button.

That’s it! You’re all set.


Redirecting a user to some custom pages in WordPress could improve user engagement. You let them know how important their comments are and in return give them back the favor.

This is just some of the few methods. If you know a way to redirect first time commenters in WordPress, do let me know in the comment below.

And by the way, if you want to see WPMakeSite comment redirect in action, go ahead and leave a comment below and, if it’s your first time, you’ll be redirected to the thank you page.

Our Most Popular Post Right Now!
Disclosure: Some of the links on this site are “affiliate links”, which allow me to earn a small referral payment if you choose to purchase the product or service.

10 Responses

    1. Hey, Greg. If you want, migrating from blogger to WordPress is so simple. You can definitely do it without the hassle.

      Thanks for stopping by.


    1. Hey there, Kathy.

      Sure you will love it. It get’s my attention the first time I made a comment on Matt’s post. Really it will help your readers.

      I look forward seeing you did it soon.

      Thanks for dropping by.


    1. Hey Kate,

      Thanks for stopping. Yes, it is! And I look forward seeing you implement it on your blog soon.


  1. I had no idea that you could do that on WordPress, how cool! I am definitely going to start doing this with my new commenters.

    1. Thanks for dropping by, Krysten.

      It really is. This is a good opportunity to engage your site visitors.

      Please try it out on your own site.


  2. Thank you for Sharing this post. Really, What a nice feature! I’m going to look into this for my blog.

    Thank you again

Leave a Reply

Your email address will not be published.

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

Recommended Book: WordPress All-in-One For Dummies
Subscribe to Blog via Email
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
This field is for validation purposes and should be left unchanged.

Don’t worry, we hate spam as much as you do.
Do you need help setting up WordPress?
I can help you with blog and site setup, full website build, performance & security, maintenance and support, and many more.
Recommended Web Hosting