How to Enable Lazy Loading for WordPress Comments

“Lazy Loading” is a technique that helps the important parts of your site load quickly for visitors.

Lazy Loading makes sure that page elements that are non-critical will load after the more important elements.

Imagine you open an article you want to read on the internet. Usually, you would start at the title and perhaps eventually read down to the comments. It makes perfect sense to load the title first and then load the comments later.

This technique can also apply to videos and images. Theses can be large elements, and often it's not necessary to display them immediately. Lazy Loading can ensure that you pull the video and image data only just before the element appears on the screen.

By default, WordPress loads the comments automatically. Lazy loading comments, particularly on posts with a big amount of comments (200-300), can improve your site performance. WordPress can load the title and body of the post and then load the comments later.

The Lazy Load for Comments plugin for WordPress prevents WordPress from displaying comments automatically and loads them on request.

The Lazy Load for Comments plugin for WordPress

Keep reading to learn how to use this plugin.


Step #1. Install the plugin

  • Click Plugins > Add new.
  • Type comments lazy load in the search box.
  • Choose the Lazy Load for Comments plugin.
  • Click Install now.
  • Click Activate.
Installing the Lazy Load for Comments plugin

Step #2. The Plugin Configuration

  • Click Settings > Discussion.
  • Scroll down until you find the Lazy Load Comments dropdown.
  • By default, On scroll is selected. Change this to On Click:
Configuring the Lazy Load for Comments plugin
  • Scroll down and click Save changes.
Saving changes in the Lazy Load for Comments plugin

Step #3. Create a Post and Add Comments

Let’s create a post to test the lazy loading functionality.

  • Click Posts > Add new.
  • Enter a proper title and text.
  • Click Publish twice.
A post with the Lazy Load for Comments plugin
  • Open the post in another browser or in an incognito tab.
  • Write a comment.
  • Click Post comment.
Testing the Lazy Load for Comments plugin

Go back to the dashboard of your site in order to approve the comment.

  • Click Comments.
  • Look for the comment.
  • Click Approve.
Results for the Lazy Load for Comments plugin
  • Go back to the Post.
  • Refresh the page.

You should see a “Load comments button” at the end of the post. If you click it, the comments will be displayed. 


Lazy Load for Comments summary

With this plugin, you can definitely improve the page loading speed for articles with many comments. Your comments will also look cleaner and organized, which improves the user experience. 

For more on comments, check our our guide to moderating comments, and our tutorial on controlling what comments authors can see.


More useful WordPress plugin recommendations


Get the PublishPress plugins

Join PublishPress today and you'll get powerful publishing and permissions plugins to improve your WordPress site.

Authors

  • Steve Burge

    Steve is the founder of PublishPress. He's been working with open source software for over 20 years. Originally from the UK, he now lives in Sarasota in the USA. This profile is generated by the PublishPress Authors plugin.

  • Jorge Montoya

    Jorge lived in Ecuador and Germany. Now he is back in his homeland of Colombia. He spends his time translating from English and German to Spanish. He loves to learn about open source technology.

Leave a Reply

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