• Skip to primary navigation
  • Skip to main content

SERT Media

  • About
  • Services
    • Maintenance
    • Speed
    • Search Optimized
      • Local SEO
    • Consulting
  • Featured Work
    • French With Benefits
    • Arielle Executive
    • You Can Live Rich On Less
  • Blog
  • Contact
  • Show Search
Hide Search

Lazy Load Your WordPress Comments For Better Performance

April 22, 2020 by Scott Hartley Leave a Comment

FacebookTwitterTumblrLinkedInPinterestRedditFlipboardMixBufferEmail

Lazy Loading comments is a simple strategy that you can implement on your website to improve your load time. If your blog posts have comments enabled and you frequently find yourself with long threads, you may be tempted to find ways to improve your load time.

There are a few options. You can split your comments into multiple pages, which is the worst option in my opinion. You can lazy load the images, which is a great half way approach. Or the final option is to lazy load all of your comments. This not only removes the HTTP requests from the images, but also reduces the initial load time.

Lazy Load For Comments Plugin

The Lazy Load For Comments plugin does just that. It allows you to load your comments either on button click or on scroll. This can dramatically improve your posts load time (as demonstrated in the above video). This is because it removes all the associated DOM elements, and improves the initial HTML render speed. It also removes all the Gravatar images, which many times are unoptimized and are served from different URLS, regardless if they are the same image or not.

Personally I am a fan of loading the comments on button click, but if you need them to load in automatically, there is an option to load them in on scroll.

Performance Improvement

On staging, I tested a page with 112 comments. I then ran a before and after report on GTMetrix. Before enabling lazy load on the comments section, the website gave the following grades as measurements.

Before Lazy Loading Comments

Page Speed Score: 36%
YSlow Score: 74%
Fully Loaded Time: 3.6 Seconds
Page Weight: 0.99MB
Request Count: 136

After Enabling Lazy Loading For Comments

After I setup Lazy Loading for the comments, we ended up with the following.

Page Speed Score: 91%
YSlow Score: 89%
Fully Loaded Time: 1.7 Seconds
Page Weight: 277KB
Request Count: 19

Closing Thoughts

Lazy Loading your comments can improve your overall load time, by no longer loading Gravatars on the initial load. One thing to keep in mind is, this plugin does load in comments via an admin-ajax.php request. But using CloudFlare, you can in theory cache this request to reduce your server load.

FacebookTwitterTumblrLinkedInPinterestRedditFlipboardMixBufferEmail

Filed Under: WordPress Tutorials Tagged With: Lazy Loading, Website Optimization, WordPress

Email Newsletter

We help bloggers, small-business owners, and creative entrepreneurs build and manage their online WordPress websites by focusing on speed, security, and search engine optimization.

No charge. Unsubscribe anytime.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Hit the ground running with an optimized website.Learn More

Copyright © 2021 · WordPress · Log in

  • Facebook
  • Twitter
  • LinkedIn
  • Github
  • YouTube