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

Redirect first time commenters

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 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.

It basically says,

Hey, thank you for sharing your thoughts! I really loved what you have to say. And if possible, could you subscribe to my list? I can send you similar posts directly to your inbox.

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
Redirect First Time Commenters in WordPressClick To Tweet

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 commenter 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.

Fusion Builder Gif

(Source: Avada)

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.

Note: You MUST change “http://yourdomain.com/thank-you-for-commenting/” 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 beginners, I personally don’t recommend this method. So, we are going 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.

Yoast Comment Hacks setting page

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.

Conclusion

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.

2017-09-06T01:25:48+00:00

About the Author:

Rodney Lacambra is the founder and editor of WPMakeSite Blog and is a freelance WordPress Developer by profession. Learn more about him here and connect with him on Facebook, Twitter, Google+ and LinkedIn.

10 Comments

  1. Greg Manuel July 21, 2017 at 10:55 pm - Reply

    I unfortunately started my blog on blogger… wish I had gone with WordPress…

    • Rodney Lacambra July 22, 2017 at 12:12 am - Reply

      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.

      ~Rod

  2. Kathy Brown July 21, 2017 at 11:54 pm - Reply

    I love this feature and plan on implementing it this weekend. Thanks for sharing.

    • Rodney Lacambra July 22, 2017 at 12:15 am - Reply

      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.

      ~Rod

  3. Kate July 22, 2017 at 3:41 am - Reply

    What a neat feature! I’m going to look into this for my blog. THanks!

    • Rodney Lacambra July 22, 2017 at 8:47 am - Reply

      Hey Kate,

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

      ~Rod

  4. Krysten July 27, 2017 at 6:57 am - Reply

    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.

    • Rodney Lacambra July 27, 2017 at 10:16 am - Reply

      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.

      ~Rod

  5. Prady September 1, 2017 at 2:46 pm - Reply

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

    Thank you again

  6. Harpreet Kumar September 21, 2017 at 11:20 pm - Reply

    I love the way creating a thank you page using coding. Thank you for this golden piece of content sir

Leave A Comment

13 Shares
Share13
Tweet
+1
Share
Pin
Stumble

Like my WordPress tips?

Enjoy reading more great WordPress articles via email. Subscribe to the newsletter today!

This information will never be shared for third part