Start Debugging
2019-05-01 Updated 2023-11-05 lighthouse

Lighthouse report: Defer offscreen images in WordPress

Improve your WordPress site's Lighthouse performance score by deferring offscreen images with lazy loading.

One of the most important things when it comes to perceived performance is how fast a web page loads when it’s first accessed, and one of the key things in having a fast-loading web page is to only load what’s necessary, when necessary.

Of course, this might sound like a lot of work, but there are some low hanging fruits when it comes to this, especially when we look at images. Images usually take up the most bandwidth when loading a website and traditionally, you just load everything.

There are several disadvantages to doing that:

The solution: defer and load images only when they come into view. And because I’ve mentioned it’s a low hanging fruit – there’s a plugin for doing just that: Lazy Load Optimizer.

Just add it to your WordPress site and you’re done. Now when users will access your web page they will only download the images found inside their view. All other images will be lazy loaded only as the user scrolls through.

This one thing alone bumped the performance rating of the blog by 20 points, from 41 to 61. Let’s see where we go next.

Troubleshooting

I personally had some troubles after installing the plugin with a couple of images blowing up like so:

This was because of some hardcoded styling I had on the img tags themselves, which is anyways considered bad practice. I’ve moved everything in a couple of CSS classes that load up separately and now everything is fine.

< Back