How to Implement Lazy Loading for Images and Videos in WordPress

Why Lazy Loading Matters
Without lazy loading, all media on a page loads immediately — even if it’s not visible on the screen yet. This causes:
- Higher page weight
- Longer initial load time
- Worse performance scores in PageSpeed Insights
Lazy loading solves this by only loading media as the user scrolls down. It improves speed and saves bandwidth.
Lazy Loading for Images in WordPress
Since version 5.5, WordPress automatically adds the loading="lazy"
attribute to images inserted via the editor. You don’t need any plugins to enable it.
How to Check If It’s Working:
- Right-click an image → Inspect element
- Look for:
<img src="..." loading="lazy">
- If the attribute is missing — check your theme’s image markup or use a plugin
Tip:
Some older themes override or strip out loading="lazy"
. In this case, you can manually add it via filters or switch to a modern theme.
Lazy Loading for YouTube and Videos
YouTube iframes and embedded videos can significantly slow down page speed. Use the following methods:
- Use a preview image (poster) and only load the iframe on click
- Plugins like WP YouTube Lyte or Lazy Load for Videos
- Use a lightweight thumbnail and replace it with iframe dynamically using JavaScript
Example placeholder HTML:

Recommended Lazy Loading Plugins
- a3 Lazy Load – Lightweight and configurable
- WP Rocket (Premium) – Full media lazy loading with optimization
- Perfmatters – Includes lazy load and script manager
Potential Issues to Watch For
- Images or videos “popping in” too late — use proper spacing
- Search engines not seeing media — modern crawlers support lazy loading, but check critical content
- Broken media for older browsers — test fallback if needed
Testing Lazy Load Performance
- Use PageSpeed Insights → see reduced image load time
- Chrome DevTools → Network → filter by media → scroll and observe loading behavior
Want It Done Right?
Lazy loading is simple but powerful. Let SpeedWP Pro check your WordPress site for media bloat, lazy load issues, and hidden blockers — all in one free audit.