Skip to main content

Responsive and Adaptive Images

Responsive images prevent mobile devices from downloading desktop-sized images. WordPress already generates multiple sizes and emits srcset/sizes for most images. Your job is to validate it's working for your templates and not being broken by builders, custom markup, or a CDN setup.

Responsive vs Adaptive

ApproachWhere the Choice HappensTypical Tooling
Responsive imagesBrowser chooses from srcsetWordPress core + theme markup
Adaptive imagesServer/CDN chooses based on device/networkCloudflare/Bunny/etc.

WordPress Default Behavior

When you upload an image, WordPress generates multiple sizes and typically emits:

  • srcset (available widths)
  • sizes (how wide the image will render)

CLS Safety

Always reserve space:

responsive-image-with-dimensions.html
<img
src="/uploads/hero-1200.webp"
srcset="/uploads/hero-640.webp 640w, /uploads/hero-1200.webp 1200w"
sizes="(max-width: 640px) 640px, 1200px"
width="1200"
height="630"
alt="Hero"
/>

Validation (DevTools)

  1. DevTools -> Network, reload with cache disabled.
  2. Click the hero/product image request.
  3. Confirm the downloaded image width matches the viewport.
  4. Test on a mobile viewport emulation and confirm a smaller file is chosen.

What's Next