How to Fix Missing Image Dimensions on Shopify & WooCommerce
errorThe Problem
Your images are missing explicit width and height attributes. When the browser loads your page, it doesn't know how much space to reserve for images until they download. This causes the page layout to jump and shift — a problem called Cumulative Layout Shift (CLS).
trending_upWhy It Matters for SEO
CLS is a Core Web Vital that directly impacts your Google rankings. Every time content shifts on the page, users get frustrated — especially on mobile. Google measures this and penalizes pages with high layout shift. Adding width and height to images is one of the easiest CLS fixes.
buildHow to Fix It
- 1
Most Shopify themes use the `img_url` filter which doesn't include dimensions by default.
- 2
Go to Online Store → Themes → Edit Code.
- 3
Search your theme files for `<img` tags that are missing width and height.
- 4
For product images, use Shopify's image object properties to add dimensions.
- 5
For the best approach, use the `image_tag` filter which includes dimensions automatically.
<!-- Bad: no dimensions -->
<img src="{{ image | img_url: '500x' }}" alt="{{ image.alt }}">
<!-- Good: explicit dimensions -->
<img src="{{ image | img_url: '500x' }}" alt="{{ image.alt }}" width="{{ image.width }}" height="{{ image.height }}">
<!-- Best: use image_tag filter (Shopify 2.0+) -->
{{ image | image_url: width: 500 | image_tag }}Related Fix Guides
How to Fix Slow Page Speed on Shopify & WooCommerce
Your store is too slow. Learn the fastest fixes for Shopify and WooCommerce page speed — image optimization, app audits, caching, and more.
How to Fix Missing Image Alt Text on Shopify & WooCommerce
Fix missing image alt text on your ecommerce store. Boost Google Image search traffic and accessibility with proper alt attributes on product images.
Want to check if YOUR store has this issue?
Scan your site for free — get copy-paste fixes in 60 seconds.
searchScan Now — It's Free