New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

Images

Learn how to enable WordPress lazy loading.

Lazy loading defers off-screen images until users scroll. WordPress enables it by default since 5.5, but themes and plugins can break it or lazy load the wrong image. This guide configures native lazy load and fixes Core Web Vitals side effects.

Time: 15-30 minutes Level: Beginner
Neil McNaught, founder of BugShield and WordPress author
Written by
Written by
Updated
Updated

What this problem looks like

Double lazy loading happens when a theme, page builder, and cache plugin each add their own lazy load JavaScript. Images never appear until scroll triggers twice.

The largest contentful paint image must not lazy load. Google PageSpeed flags LCP delay when heroes use loading="lazy" incorrectly.

Step 1: How WordPress native lazy load works

WordPress filters attachment image attributes to add loading="lazy" automatically. Iframes get the same via wp_iframe_tag filter. No plugin is required for basic behaviour.

Step 2: Exclude specific images from lazy load

Use the loading attribute on block image blocks in the editor, or filter by class in your theme for the hero template. Add this to your child theme functions.php:

php
add_filter( 'wp_lazy_loading_enabled', function( $default, $tag_name, $context ) {
	if ( 'img' === $tag_name && 'the_content' !== $context ) {
		return false;
	}
	return $default;
}, 10, 3 );

Step 3: Disable lazy load when debugging

To turn off core lazy load site-wide during diagnosis, add this to functions.php:

php
add_filter( 'wp_lazy_loading_enabled', '__return_false' );

Step 4: Page builders and WooCommerce galleries

Elementor, Divi, and Bricks may add data-src lazy patterns. Pick one system. For WooCommerce, main product image should load eagerly. Thumbnail carousel images can lazy load safely.

Step 5: Measure impact in PageSpeed Insights

Run mobile PageSpeed before and after. Watch LCP element timing and deferred offscreen images audit. Adjust hero exclusions until LCP passes consistently.

When to stop DIY and hire help

Custom themes with complex sliders need hand-tuned LCP markup. BugShield aligns lazy loading with Core Web Vitals on marketing and shop templates at a confirmed price without hourly billing surprises.

Questions answered

WordPress lazy loading FAQs

Answers about native lazy loading, above-the-fold images, Largest Contentful Paint, exclusions, JavaScript conflicts, and testing real pages.

Is lazy loading bad for SEO?

Google supports native lazy loading. Problems appear when LCP images lazy load or content never loads for crawlers due to broken JavaScript.

Should I use a lazy load plugin?

Usually no if WordPress core and your theme cooperate. Plugins help legacy themes that lack native support.

Why are images blank until I scroll?

Conflicting lazy load scripts or JavaScript errors. Disable lazy load in one plugin at a time to find the duplicate.

Does lazy load work on background CSS images?

No. Native lazy load applies to img and iframe tags. CSS backgrounds need different techniques.

Does WordPress include native image lazy loading?

Yes. Modern WordPress adds browser-native lazy-loading attributes to many images and iframes, although themes and plugins can alter that behaviour.

Which WordPress images should not be lazy loaded?

Exclude the logo, hero image, likely Largest Contentful Paint image, and other media visible immediately when the page opens.

Can lazy loading make Core Web Vitals worse?

Yes. Delaying the main visible image can worsen Largest Contentful Paint, while JavaScript-based loading can cause layout shifts if dimensions are missing.

How do I exclude an image from WordPress lazy loading?

Use the theme or optimisation plugin exclusion setting, or adjust the image attribute through tested code. Match a stable class, URL, or position.

Why does a lazy-loaded WordPress image never appear?

The loading script may fail, an optimisation tool may rewrite markup incorrectly, or a CSS background image may not be supported by the chosen method.

How do I test WordPress lazy loading?

Test representative pages on a throttled mobile connection, inspect image requests and attributes, scroll through the full page, and compare Core Web Vitals before and after.

Would you rather a developer fixed it?

Request a fix at a confirmed price and speak directly with the BugShield developer working on your site.

Request a Fix