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
- Open the page and choose View Source.
- Find an
<imgtag. - Look for
width="..."andheight="..."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.
- Put the real pixel size in the tag. Use the image's actual dimensions, for example
width="800" height="600".
- Keep it responsive. Add this to your CSS so the image still shrinks on a phone:
img { max-width: 100%; height: auto; }
- 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.
- On Next.js, the
Imagecomponent needs bothwidthandheight, unless you usefillor a static import.
- Plain HTML: write them in the tag, or set
aspect-ratioin 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
Checked on 19 Nov 2026.