5

i have many Wordpress posts with over 200 comments, so i need to improve the speed of these posts.

In particolar, i want to improve PageSpeed Insights score, because now it reports "Avoid an excessive DOM size", caused by comments.

I try the plugin Lazy load for comments, but the score on PageSpeed Insights doesn't improve. With this plugin, Googlebot see all the same with all comments (and it's good for SEO), but the score on PageSpeed Insights is still the same.

So other solution is to active ‘Break comments into pages’ option in Wordpress. In this case, the comments are splits in many pages with pagination. I have Yoast SEO plugin, so for every page generated by pagination, like "comment-page-1", etc.., there is rel="canonical", but there is also index. Infact, this plugin has disabled the option for noindex pagination (source).

In my niche, old comments are worthless and are not important to users who visit the post today. Also i don't want to risk showing the pagination of comments in the SERP.

So i try noindex the pagination comments with this snippet for functions.php, but it works only for all URLs with "/page/" in the url (source):

add_filter("wpseo_robots", function($robots) {
    if (is_paged() && is_archive()) {
        return 'noindex,follow';
    } else {
        return $robots;
    }
});

The question is: what is the best way for manage many comments in Wordpress and improve PageSpeed Insights score, destroyed by too many comments?

hermes_44
  • 51
  • 1

2 Answers2

1
  • order comments by votes or most recent first
  • paginate content
  • nofollow the pagination and
  • noindex the component pages.

That way you can still show the full count of comments (to support your claims of popularity of the content) w/o a slow page 1 and w/o having indexed and even crawlable component pages that only contain less than perfect comments

0

I want to let you know that WordPress version 5.9 started lazy loading images and iframes which in turn improves the largest contentful paint of a website.

Now, talking about how you can improve the loading time of your webpage having too many comments, you can fold the comments.

dan
  • 15,153
  • 11
  • 46
  • 52