Skip to content
Launch offer 50% off your first year of Keel Pro. See prices →

Speed

Lazy loading and loading the main image first

Make the top of the page appear sooner: images and embeds further down wait, and the main image at the top gets top priority. Settings, exceptions and how to check the result.

3 minutes read · Updated November 28, 2026

A page often loads dozens of images and several embeds the visitor has not scrolled to yet, and they all compete for bandwidth with what is actually on screen. Lazy loading makes them wait until they are needed. The most important image, the big one at the top, should do the opposite: load first. Keel does both.

Turn on lazy loading

  1. Open Keel › Speed › Lazy loading.
  2. Switch on Lazy load images. Every image waits until it is about to scroll into view, including images in text fields and hard-coded images in your theme.
  3. Switch on Lazy load videos and embeds. YouTube, Vimeo, maps and other embeds wait too. These are often the heaviest things on a page, so this switch usually saves more than the first.

Leave the top images alone

The logo and the hero image are visible immediately, so they must not wait. Images at the top that load immediately sets how many images at the start of the page skip lazy loading. Two suits most layouts: the logo and the hero. Raise it if your header has several images, such as a logo, a badge and a hero.

To exclude a specific image anywhere on the page (an image in a slider or tab that a script measures, for example), give it a CSS class and add that class to Never lazy load images with these classes.

Load the main image first

Load the main image first finds the first large image at the top of the page and gives it top download priority, so the browser starts fetching it before less important files, even before it has finished reading the styles.

That image is usually what Google measures for Largest Contentful Paint, one of the three Core Web Vitals. Logos and images with the class no-hero are skipped, so the priority goes to the right image.

Video previews (Keel Pro)

Even lazy loaded, a video player loads hundreds of kilobytes of scripts as the visitor scrolls past. Video previews instead of players shows a YouTube or Vimeo video as its thumbnail with a play button; the real player loads only when someone clicks. That saves around 700 KB per video. Add data-no-facade to an iframe to keep a normal player there.

Check the result

  1. Run the page through PageSpeed Insights on mobile, before and after.
  2. Look at Largest Contentful Paint. It should drop.
  3. Expand the LCP element in the diagnostics. It must not say the image was lazily loaded.
  4. Scroll down the page on a phone. Images should appear as you reach them, without blank gaps.

Troubleshooting

Problem Fix
An image at the top pops in late Raise Images at the top that load immediately.
A slider or gallery shows blank slides Add the slider images’ class to Never lazy load images with these classes.
The wrong image gets priority Give the image that should not be the hero the class no-hero.
Text jumps as images load The images lack width and height. Images from the media library have them; check images added with custom HTML.

Every setting on this screen

The same explanations you see next to each setting in Keel.

Keel › Speed › Lazy loading

Setting What it does
Lazy load images Every image on the page waits until it is about to scroll into view, including images in text fields and hard-coded ones.
Lazy load videos and embeds YouTube, Vimeo, maps and other embeds wait until they are needed. These are often the heaviest things on a page.
Images at the top that load immediately The logo and the hero image are visible straight away, so they should not wait. 2 suits most layouts.
Never lazy load images with these classes Add one of these CSS classes to an image to always load it immediately. Separate several with spaces.
Load the main image first The first large image at the top of the page (the hero) is what Google times as "Largest Contentful Paint". It gets top download priority and starts loading before the styles. Logos and images with the class "no-hero" are skipped.
Video previews instead of players (Pro) YouTube and Vimeo videos show their picture with a play button; the real player loads when clicked. Saves about 700 KB per video. Add data-no-facade to an iframe to skip it.
Still stuck?

Pro customers: use Support in your account. Everyone else: write to us, we read everything.

Contact

Five minutes from now

Give your site a keel.

Steady when traffic spikes, calm when attacks come, found when people search. Start free; go Pro when a site needs more.