Do you want to lazy load Gravatars in WordPress comments?
Every time a comment is added to your site, WordPress makes an HTTP request to Gravatar to retrieve the commenter’s avatar. This can slow down your site’s page load speed, particularly on articles with a lot of comments.
In this article, we will show you how to easily lazy load Gravatars in WordPress comments and improve your website speed.
Why Lazy Load Gravatars in WordPress Comments?
Gravatar is a super popular web service that enables users to create a profile and associate an avatar image with their email address.
These images are then used in the WordPress comments each time the visitor uses that particular email address. This is because WordPress-powered websites can fetch profile photos from the Gravatar website.
Even though Gravatars are great for user engagement, each user Gravatar adds an HTTP request to your page load.
This increases the time that users will have to wait to see the content on your page and can affect the user experience.
For example, in the screenshot below, you can see the number of HTTP requests sent by different Gravatars.
Lazy loading Gravatars in your comments section prevents loading them until the Gravatars are actually visible to the user on the screen.
This can help reduce the amount of bandwidth that your website uses and improve your overall WordPress speed and performance.
Having said that, let’s see how to easily lazy load Gravatars in WordPress comments.
How to Lazy Load Gravatars in WordPress Comments
Upon activation, visit the Settings » a3 Lazy Load page from the WordPress admin sidebar and open the ‘Lazy Load Images’ tab.
From here, you need to toggle on the switch next to the ‘Gravatars’ option. Now, all the Gravatars on your site, including the ones in the comments sections and author bio, will be lazy-loaded to improve site speed.
Once you are satisfied, just click the ‘Save Changes’ button at the bottom to store your settings.
With this plugin, you can also lazy load images in your WordPress content, thumbnails, videos, and more.
You can even choose a loading effect for Gravatars by scrolling down to the ‘Effect & Style’ tab.
From here, choose the spinner or fade-in loading effect. You can also select a loading background color that will be displayed to users while the Gravatar is loading on your site.
Once you’ve made the changes, don’t forget to click the ‘Save Changes’ button to store your settings.
You can now visit any article with comments on your WordPress website. As you scroll down, you will notice the lazy loading of Gravatar images.
Bonus Tips for Improving WordPress Site Speed
However, if you don’t want to lazy load these parts of your site, then you can also try:
- Optimizing images using the smallest possible file size
- Using a WordPress caching plugin such as WP Rocket
- Using WordPress plugins and themes that are optimized for speed
For more tips, you can see our ultimate guide on how to boost WordPress speed and performance.
If you have tried all these methods and your website speed still hasn’t improved, then we recommend switching to a fast WordPress hosting provider like Hostinger.
Hostinger did very well in our WordPress performance tests. Plus, they are offering our readers an exclusive discount on their hosting plans, starting at just $2.69 per month.
Finally, once you have switched your hosting and used all our tips for speeding up your site, you can easily test your website’s performance using different tools.
For detailed instructions, see our tutorial on how to properly run a website speed test.
We hope this article helped you lazy load Gravatars in WordPress comments. You may also want to see our beginner’s guide on how to moderate comments in WordPress and our expert picks for the best plugins to improve WordPress comments.