Sitewalk / Guides / Issue guides / Images without width and height

Images without width and height: stop the page jumping

You open a page. The text starts to read, then it drops down because an image above it just loaded. That jump is a layout shift. A common cause is an image with no width and height, so the browser does not know how much room to keep for it.

Check your page in 2 minutes

  1. Open the page and choose View Source.
  2. Find an <img tag.
  3. Look for width="..." and height="..." inside it.
<img src="photo.jpg" alt="A photo" width="800" height="600">

If both are missing, the browser has to wait for the file before it can place anything below it.

Why it matters

Google's web.dev guidance lists "images without dimensions" among the main causes of layout shift. Layout shift is measured as Cumulative Layout Shift. A good score is 0.1 or less at the 75th percentile of page loads; above 0.25 is poor.

How to fix it

web.dev says: always include width and height on images and video, or reserve the space with CSS aspect-ratio.

  1. Put the real pixel size in the tag. Use the image's actual dimensions, for example width="800" height="600".
  1. Keep it responsive. Add this to your CSS so the image still shrinks on a phone:
img { max-width: 100%; height: auto; }
  1. On WordPress, core has a function, wp_img_tag_add_width_and_height_attr(), for image tags that lack the attributes. The usual gaps are images printed by hand in a theme template or inserted by a page builder, so check those.
  1. On Next.js, the Image component needs both width and height, unless you use fill or a static import.
  1. Plain HTML: write them in the tag, or set aspect-ratio in CSS on the image.

How to check it worked

View source and confirm each image has both attributes. Then test the page in PageSpeed Insights and look at Cumulative Layout Shift. Then run an audit.

What Sitewalk found on real sites

Of 95 audited sites, on the latest audit of each, 40 (42%) had at least one page with images missing width and height. Early users, so a first look and not a survey.

Check your whole site

Sitewalk looks at every image on every page it crawls, with 200+ other technical checks. In ChatGPT, say:

Audit yoursite.com for technical SEO problems

Get started

Checked on 19 Nov 2026.

More guides

All issue guides ยท All guides