How to Enable Lazy Loading in WordPress: A Complete Guide
Images are an important part of most WordPress websites, but loading every image as soon as a page opens can increase the amount of data the browser needs to download. This can make long pages feel slower, particularly for visitors using mobile devices or slower internet connections.
Lazy loading solves part of this problem by delaying the loading of certain images and other resources until they are close to becoming visible on the screen.
WordPress provides built-in lazy-loading functionality for supported images, while plugins and performance tools can provide additional controls.
In this guide, you’ll learn what lazy loading is, how to enable it in WordPress, how to configure it correctly, and what mistakes to avoid.
What Is Lazy Loading?
Lazy loading is a technique that postpones loading a resource until it is likely to be needed.
Consider a blog article containing 30 images. When a visitor first opens the page, they may only see the first two or three images.
Without lazy loading:
Page opens
↓
Browser loads many images
↓
Page becomes heavier
With lazy loading:
Page opens
↓
Important visible content loads
↓
Nearby images load as the visitor scrolls
This can reduce the amount of data required during the initial page load.
Why Enable Lazy Loading in WordPress?
Lazy loading can be useful for image-heavy websites because it can reduce the number of resources that need to be loaded immediately.
Potential benefits include:
- Faster initial page loading
- Lower initial bandwidth usage
- Better mobile performance
- Fewer resources loaded immediately
- Improved perceived page responsiveness
- Reduced data transfer for visitors who don’t scroll through the entire page
Lazy loading is especially useful for:
- Long blog posts
- News websites
- Photography websites
- Portfolio websites
- Online stores
- Product catalogs
- Media-heavy landing pages
However, lazy loading is only one part of WordPress performance optimization.
Does WordPress Support Lazy Loading?
Modern WordPress installations provide native lazy-loading behavior for supported images.
This means that in many cases, you don’t need to install a separate plugin simply to get basic image lazy loading.
WordPress can add appropriate loading behavior to certain images generated through standard WordPress functionality.
However, the exact behavior can depend on:
- WordPress version
- Theme implementation
- Image markup
- Plugins
- Custom code
- Performance configuration
Therefore, always check the actual HTML generated by your website rather than assuming every image is lazy-loaded.
Method 1: Use WordPress’s Built-In Lazy Loading
For many websites, the simplest approach is to use WordPress’s native functionality.
Step 1: Keep WordPress Updated
Make sure your WordPress installation is running a current supported version.
Go to:
Dashboard → Updates
Check whether WordPress has any available updates.
Also update your theme and plugins after confirming compatibility.
Step 2: Use WordPress Image Blocks
When adding an image to a post or page, use the standard WordPress Image block whenever possible.
Go to:
Posts → Add New
or:
Pages → Add New
Then select:
+ → Image
Upload or select an image from the Media Library.
WordPress can apply appropriate loading attributes to supported image markup.
Step 3: Publish or Update the Page
Save your changes and open the page on the front end.
You can inspect the generated HTML using your browser’s developer tools to determine whether the expected loading behavior is present.
Method 2: Enable Lazy Loading Through a Performance Plugin
A performance or caching plugin may provide additional lazy-loading controls.
Depending on the plugin, you may find settings for:
- Images
- Background images
- Videos
- Iframes
- Embedded content
- CSS background images
The exact menu names vary between plugins.
A typical setup may look like:
WordPress Dashboard → Performance/Cache Plugin → Media → Lazy Load
Then enable the image lazy-loading option.
Before enabling it
Create a backup and test the website.
Some plugins can change how images, videos, sliders, and page-builder elements are loaded.
Method 3: Use a Dedicated Image Optimization Plugin
Some image optimization tools combine compression, modern image formats, responsive images, CDN delivery, and lazy loading.
This can be convenient if you want to manage several image-performance features from one system.
Before choosing a plugin, check whether it supports:
- WordPress’s current versions
- Your theme
- WebP or AVIF
- Responsive images
- CDN delivery
- Background images
- Iframes
- Exclusions
Avoid installing multiple plugins that all try to control lazy loading.
Method 4: Add Lazy Loading Manually
Advanced WordPress users can add the loading attribute directly to image markup.
For example:
<img src="example.jpg" alt="Example image" loading="lazy">
The loading="lazy" attribute tells the browser that the image can be loaded lazily.
For an image that should load immediately, you can use:
<img src="hero.jpg" alt="Website hero image" loading="eager">
However, manually changing every image isn’t usually necessary on a modern WordPress installation.
Before adding custom code, check whether WordPress, your theme, or your performance plugin already handles lazy loading.
Don’t Lazy-Load Every Image
One of the most important rules of lazy loading is:
Not every image should necessarily be lazy-loaded.
Images that appear immediately when the page opens may be important to the initial visual experience.
For example, your homepage may contain a large hero image:
Logo
Navigation
Hero heading
Hero image
If the hero image is unnecessarily delayed, the browser may take longer to display the main visual content.
For important above-the-fold images, it may be better to let the browser prioritize them.
What Is Above-the-Fold Content?
Above-the-fold content is the portion of the page that visitors can see before scrolling.
For example:
+--------------------------------+
| Logo Navigation |
| |
| Main Heading |
| Description |
| [Important Hero Image] |
+--------------------------------+
↓ Scroll
+--------------------------------+
| Additional content |
| More images |
+--------------------------------+
The hero image may be visible immediately, while the images below the scroll area can usually be candidates for lazy loading.
Lazy Loading Images Below the Fold
Images that appear farther down the page are usually better candidates for lazy loading.
For example:
Hero image → Load normally
Introduction image → Load normally/priority based on context
Article image 1 → Lazy load
Article image 2 → Lazy load
Article image 3 → Lazy load
Gallery images → Lazy load
Footer images → Lazy load
The exact behavior should depend on the page layout.
How to Check Whether Lazy Loading Is Working
You don’t have to rely solely on a plugin’s settings page.
You can inspect the HTML generated by your website.
Step 1: Open Your Website
Visit the page you want to test.
Step 2: Open Developer Tools
In Chrome or another modern browser, right-click the page and select:
Inspect
Step 3: Search for an Image
Look for an image element such as:
<img src="image.webp" loading="lazy" ...>
The presence of loading="lazy" indicates that native browser lazy-loading behavior has been requested for that image.
Remember that the browser ultimately determines when resources are loaded.
Test Lazy Loading With a Long Page
A useful test is to open a page containing many images.
Then:
- Open the browser’s developer tools.
- Go to the Network tab.
- Filter for images.
- Reload the page.
- Watch which images are requested initially.
- Slowly scroll down the page.
- Observe additional image requests.
This can help you understand how resources are being loaded.
Lazy Loading and Core Web Vitals
Lazy loading can contribute to better performance when it prevents unnecessary resources from being loaded during the initial page load.
However, careless lazy loading can have the opposite effect.
For example, delaying the main content image can potentially hurt metrics associated with how quickly the primary content becomes visible.
When optimizing WordPress, pay attention to:
- Largest Contentful Paint (LCP)
- Interaction to Next Paint (INP)
- Cumulative Layout Shift (CLS)
Don’t enable lazy loading simply because a performance plugin recommends it. Test the result.
Use Proper Image Dimensions
Lazy loading works best when combined with correctly sized images.
Suppose your website displays an image at:
800 × 500 pixels
but you upload:
5000 × 3125 pixels
Lazy loading delays the request, but once the image is needed, the browser may still download the unnecessarily large file.
A better strategy is:
Resize
↓
Compress
↓
Choose efficient format
↓
Use responsive image sizes
↓
Lazy-load when appropriate
Lazy loading should therefore be part of a broader image optimization strategy.
Combine Lazy Loading With WebP or AVIF
Modern image formats can reduce image file sizes.
Instead of relying on lazy loading alone, combine it with efficient image delivery.
For example:
Large JPEG
↓
Resize
↓
Compress
↓
Convert to WebP/AVIF
↓
Serve responsively
↓
Lazy-load below-the-fold images
This approach reduces both when the image is loaded and how much data must be downloaded.
Lazy Loading for YouTube and Other Iframes
Images aren’t the only resources that can be delayed.
Embedded content such as:
- YouTube videos
- Maps
- Social media widgets
- External forms
- Other iframes
can also generate network requests.
A page containing several embedded videos may become heavy if all of them load immediately.
Some performance tools support lazy loading for iframes.
For example:
<iframe
src="https://example.com"
loading="lazy">
</iframe>
For third-party embeds, test carefully because delaying an iframe can affect how the embedded content behaves.
Lazy Loading Background Images
Background images are different from normal <img> elements.
A theme may load them through CSS such as:
.hero {
background-image: url("hero.jpg");
}
Native image lazy loading does not automatically apply to every CSS background image.
Some performance plugins can detect and optimize background images, but this functionality varies.
If your theme uses large background images, test their loading behavior separately.
Lazy Loading and WordPress Page Builders
Popular page builders may generate custom markup for images and other elements.
Examples include:
- Image widgets
- Background sections
- Galleries
- Sliders
- Video elements
A page builder may interact with your caching or optimization plugin.
After enabling lazy loading, test:
- Desktop layout
- Mobile layout
- Image galleries
- Sliders
- Background sections
- Video embeds
- Animations
If an important visual element doesn’t appear correctly, exclude that resource from lazy loading.
How to Exclude an Image From Lazy Loading
Sometimes a particular image needs to load immediately.
The exact exclusion method depends on the performance plugin you’re using.
Common exclusion options may include:
- Image URL
- Filename
- CSS class
- HTML attribute
- CSS selector
For example, a plugin might allow you to exclude:
hero-image.webp
from lazy loading.
The exact configuration should follow the documentation for your chosen plugin.
Common Lazy Loading Problems
1. Hero Image Loads Too Slowly
If your main hero image is being lazy-loaded unnecessarily, it may take longer to appear.
Solution: Exclude important above-the-fold images from lazy loading when appropriate.
2. Images Appear Late While Scrolling
Some aggressive lazy-loading systems may wait too long before requesting images.
Solution: Review the plugin’s loading threshold and test on mobile devices.
3. Images Don’t Appear
JavaScript-based lazy-loading implementations can sometimes conflict with themes, caching systems, or other optimization plugins.
Solution: Temporarily disable conflicting optimization features and test the page.
4. Sliders Stop Working
A slider may expect images to be available immediately.
Solution: Exclude slider images or adjust the slider’s loading configuration.
5. Background Images Don’t Load Correctly
CSS background images may require separate handling.
Solution: Check whether your optimization plugin supports background-image lazy loading.
Common Mistakes to Avoid
Lazy-Loading the Main LCP Image
Delaying the primary visible image can hurt initial page rendering.
Installing Multiple Lazy-Loading Plugins
Multiple systems can interfere with one another.
Ignoring Mobile Testing
A lazy-loading configuration that works on desktop may behave differently on mobile.
Forgetting Background Images
CSS backgrounds may not behave like standard <img> elements.
Combining Lazy Loading With Oversized Images
Delaying a huge image doesn’t make the image itself smaller.
Not Testing Interactive Content
Sliders, galleries, videos, and page-builder components should be tested after configuration changes.
Best Practices for WordPress Lazy Loading
For a reliable implementation:
- Keep WordPress and your plugins updated.
- Use native WordPress behavior where it meets your needs.
- Lazy-load images that are below the initial viewport.
- Avoid delaying important above-the-fold content.
- Resize and compress images before delivery.
- Use responsive image sizes.
- Consider WebP or AVIF.
- Lazy-load heavy iframes where appropriate.
- Test background images separately.
- Monitor Core Web Vitals.
- Avoid overlapping optimization plugins.
- Test desktop and mobile layouts.
- Exclude critical images when necessary.
- Re-test after theme or plugin changes.
WordPress Lazy Loading Checklist
Before considering your setup complete, check the following:
- WordPress is updated
- Images are properly resized
- Images are compressed
- Modern image formats are considered
- Responsive images are being served
- Below-the-fold images use lazy loading
- Important above-the-fold images aren’t unnecessarily delayed
- Large iframes are reviewed
- Background images are tested
- Sliders and galleries work correctly
- Mobile performance has been tested
- Core Web Vitals have been checked
- Multiple lazy-loading systems aren’t conflicting
Final Thoughts
Lazy loading is a useful technique for improving the initial loading experience of a WordPress website, especially when pages contain many images or embedded resources. However, simply enabling lazy loading for everything isn’t necessarily the best approach.
A better strategy is to load critical content quickly and delay resources that aren’t immediately needed.
Combine lazy loading with properly sized images, compression, responsive image delivery, modern formats, caching, and CDN delivery for a more complete performance strategy.
Most importantly, test your website after making changes. If the main content appears slower, images fail to load, or interactive components stop working, adjust the lazy-loading configuration rather than assuming that more aggressive loading delays are always better.