Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
30 Million+
Websites using our plugins
20+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Redirect Your User’s Attention With Comment Redirect

When someone leaves their first comment on your WordPress site, they’ve already done something most visitors never do: they stopped reading and decided to engage.

But after they hit ‘Submit Comment’, WordPress usually gives them a generic message and leaves the interaction there. That’s a missed opportunity.

With a comment redirect, you can send first-time commenters to a page that thanks them and gives them a reason to stick around, whether that’s reading another post, joining your email list, or checking out your products.

In this guide, we’ll show you three ways to set up comment redirection in WordPress.

How to redirect user attention with comment redirect

Quick Answer: Redirecting Users’ Attention With Comment Redirect

There are three ways to redirect first-time commenters, depending on how much control you want:

  1. Free plugin. Comment Experience by Progress Planner. Install it, pick a page to redirect, and you’re done in about 2 minutes.
  2. Code snippet. Add a code snippet to your site that redirects your first-time commenters if you’d rather skip installing a dedicated comment plugin.
  3. Paid comments plugin. Use Thrive Comments if you also want comment likes, featured comments, and more alongside the redirect.

We’ll walk through all three below, starting with the free option. Before we get started, here’s everything we’ll cover in this guide:

Method 1: Redirecting Users’ Attention With Comment Experience

Comment Experience by Progress Planner (formerly Yoast Comment Hacks) is a free plugin that adds a handful of useful comment tweaks to WordPress, including a first-time commenter redirect.

First, install and activate the plugin. Go to Plugins » Add Plugin in your WordPress admin area, search for “Comment Experience”. Then click ‘Install Now’ and then activate it by clicking ‘Activate.’

Installing Comment Experience

If you need help, see our guide on how to install a WordPress plugin.

Once it’s active, go to Settings » Comment Experience and click the ‘Comment redirect’ tab. In the ‘Redirect to’ dropdown, select the page you want to send first-time commenters to. Then click ‘Save Changes.’

Redirect first time commenters to thank you page

The plugin also comes with an option to redirect repeat commenters to a different page.

If you don’t want to redirect repeat commenters, then in the ‘Redirect repeat commenters to’ dropdown, select ‘Don’t redirect repeat commenters.’ Or choose a page where you want to redirect them to from the same dropdown.

Method 2: Redirecting Users’ Attention With a Code Snippet

If you don’t want to install a plugin to redirect your users, then you can add a code snippet to your site instead. In the code snippet, we’ll use the built-in WordPress filter called comment_post_redirect to change where users are sent after a comment is submitted.

While you can copy the snippet directly into your theme’s functions.php file, the problem is that a tiny mistake in it can take your whole site down. That’s why we recommend using the WPCode plugin instead. It lets you add a code snippet to your site safely without touching your theme files.

Simply go to Plugins » Add Plugin in your WordPress dashboard and use the search box to quickly find WPCode. Click ‘Install Now’ and then ‘Activate’ when it appears.

Installing WPCode

If you need help, see our guide on how to install a WordPress plugin.

Once WPCode is installed, go to Code Snippets » + Add Snippet and choose ‘Add Your Custom Code (New Snippet).’

Adding custom code snippet on WPCode

Then, copy the following PHP snippet to WPCode:

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

function wpb_redirect_first_time_commenters( $location, $comment ) {

    $prior_comments = get_comments( array(
        'author_email' => $comment->comment_author_email,
        'status'       => 'approve',
        'count'        => true,
    ) );

    // If this commenter has no other approved comments, send them to your thank-you page.
    if ( $prior_comments <= 1 ) {
        return 'https://example.com/thank-you/';
    }

    return $location;
}

With this snippet, you’ll be redirecting first-time commenters.

Don’t forget to replace the following URL in the snippet with the URL where you want to redirect your commenters to: https://example.com/thank-you/

Then activate and save the snippet.

Adding the code snippet for comment post redirect

Method 3: Redirecting Users’ Attention With Thrive Comments

If you want to completely customize the commenting experience, then Thrive Comments is your best bet. In addition to redirecting users after a form submission, it comes with features like comment likes, featured comments, social-share prompts after commenting, and more.

You can purchase it as a standalone WordPress plugin or get full access to Thrive Suite, which comes with a complete set of conversion-focused tools for WordPress.

Once you create a Thrive Themes account, install the Thrive Product Manager plugin, where you can enable Thrive Comments. For more details, check out Thrive’s own quick-start guide.

Step-by-step guide inside a Thrive Themes account

Once Product Manager is active, go to ‘Product Manager’ in your admin sidebar, select ‘Thrive Comments,’ and click ‘Activate selected products.’

You’ll see a ‘Ready to use’ message once it’s installed.

Installing Thrive Comments

From here, go to Thrive Dashboard » Thrive Comments and expand ‘Comment Conversion. Choose the ‘Redirect’ option and enter the URL of your thank-you page.

Redirecting Comments Using Thrive Comments

Redirecting new commenters to a specific page is just the start of what you can do with Thrive Comments. You can also use this plugin to allow users to like or dislike comments, feature or bury comments, notify users only on replies to their comments, and much more.

If a simple redirect is all you’re after, Methods 1 and 2 above will cover it for free.

Test Your Comment Redirect

Before you move on, confirm the redirect works.

Open an incognito or private browser window, leave a comment on any post using a different email address that is not connected to your WordPress site.

Leaving a comment to test comment redirect

You should land on your chosen page right away.

All three methods explained in this article help you redirect your first-time commenters to a thank you page.

Comment redirect works

FAQs About Redirecting Users’ Attention With a Comment Redirect

Here are some frequently asked questions about comment redirection.

Will redirection work if comments are held for moderation?
Yes, since the redirect runs immediately after the comment is submitted, it can still send the visitor to another page even when their comment is waiting for moderation.

What should I redirect commenters to after they submit a comment?
A thank-you page is a good option, but you can also redirect commenters to a related article, a newsletter signup page, a free resource, or another page you want them to visit next.

Can I redirect commenters to a different website?
Yes. You can redirect them to an external website as well as a page on your own WordPress site. However, it’s usually better to send commenters to a relevant, expected destination rather than somewhere unrelated to the comment they just submitted.

We hope this article helped you learn how to redirect your users’ attention with a comment redirect in WordPress.

Next, you may also want to see our beginner’s guide on WordPress comment moderation and best WordPress comments plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

9 CommentsLeave a Reply

  1. One method to redirect users that was not mentioned is suggest similar posts to ones on which users have just commented. Users are more likely to comment on posts containing content that users have already found interesting.

    • Great idea, this is fantastic. I like to implement this idea in my website, thanks.
      In addition, the redirected page should show successful comment submission message with several related posts or similar posts users might be interested in.

    • Absolutely! Suggesting similar posts is a brilliant way to keep users engaged after commenting. It capitalizes on their current interest and gives them a chance to discover more relevant content. This could significantly increase user interaction and build a stronger community.

    • Exactly. I use something similar on my 404 page. To prevent users from leaving, I offer them posts that might interest them based on the similar text they were searching for. And indeed, my 404 page’s bounce rate has significantly decreased thanks to this method. So, if it’s used in the way you’re suggesting, it’s possible that this approach could drastically increase the number of page views. So as an idea, it’s really great.

  2. Thanks for the second tutorial using the hack plugin. I tried making a page where I offer users a newsletter after posting a comment and it works brilliantly. Thanks.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.