If you have a lot of comments on your posts, it would be a good idea to paginate them, mainly because of speed.
A lot of comments could affect your post’s loading time, especially on mobiles, and you don’t want that, right?
Fortunately, WordPress has a built-in feature that lets you add pagination to your WordPress comments, and I’ll show you how to use it!
Add Pagination to WordPress Comments
You can watch the video guide or continue reading. I strongly recommend reading the SEO part, though.
Step 1
Log in to your WordPress Dashboard and go to Settings > Discussion.
Step 2
Go to Other comment settings and enable Break comments into pages.
The default number of top-level comments per page is 50. Nested comments (replies) don’t count.
I think this is too much, especially if you receive lengthy comments.
I’d go about 20 comments per page.
Final step
Go to a post that has more top-level comments than the number you’ve selected, to see if and how the pagination appears.
Here’s how it looks on one of my posts about fixing HTTP error when uploading images.
The style differs from theme to theme.
If the changes don’t take place, clear your browser and site caches.
Mind the SEO
Adding pagination to WordPress comments can lead to duplicate content issues if you don’t have canonical links properly set on your site.
How come?
Well, for example, when you click on the second page to view other comments, the post will be exactly the same but with different comments.
Having a canonical link set on the post will fix that because no matter what comment page you’re on, the canonical link will point to the original post URL instead of the URL with the pagination.
This tells Google: “Yo, it’s the same post, just a different comment page!”.
WordPress has canonical links implemented, but they don’t work right
Here’s how it works in WordPress.
Let’s take this post URL as an example:
https://yourdomain.com/post-url/
This would be its canonical link in the source code:
<link rel="canonical" href="https://yourdomain.com/post-url/" />
When you go to another comment page, this will be the post’s URL:
https://yourdomain.com/post-url/comment-page-2/#comments
This is where WordPress gets it wrong because it changes the canonical link to:
<link rel="canonical" href="https://yourdomain.com/post-url/comment-page-2/#comments" />
The canonical link should remain the same as the initial post URL, regardless of the comment page:
<link rel="canonical" href="https://yourdomain.com/post-url/" />
Theoretically, Google’s algorithms are smart enough to deal with this kind of situations, but I don’t trust them, and neither should you.
Until they literally discover pure artificial intelligence, make sure to always implement best practices and apply the “better safe than sorry” rule.
Use Yoast SEO to prevent duplicate content issues
Yoast SEO is a must-have WordPress plugin if you care about SEO,
There are other SEO plugins, but I’ve always used and recommended Yoast.
By default, the Yoast SEO plugin will add proper canonical links on your WordPress website. You don’t have to configure anything for that.
Yoast’s canonical links won’t change depending on the comment pagination, as those from WordPress do.
That’s a Wrap
I hope you found this tutorial useful and comprehensive, and you managed to add pagination to your WordPress comments!
If you have any questions or thoughts, drop a comment or send a message via contact or Facebook page.
You can also hit the follow button on Twitter and subscribe to the YouTube channel.
Don’t forget to share the post to help out others!
Leave A Comment