Add alt text and dimensions to images
Describe meaningful images for screen readers and search engines, mark decorative ones correctly, and set width and height so the layout does not jump.
The problem
Images have no alt attribute, or no width and height attributes.
How to spot it
- Screen readers announce the image file name.
- Content jumps down as images load (layout shift).
Why it matters
Alt text is how people who cannot see an image understand it, and it helps search engines understand images too. Dimensions let the browser reserve space before the image arrives.
What happens if you leave it
An accessibility failure for screen-reader users, missed image search visibility, and a jumpy, frustrating page.
How to fix it
-
Meaningful images: describe what the image shows and why it is there, in a short sentence:
<img src="/team.jpg" alt="Our three plumbers standing beside the service van" width="1200" height="800"> -
Decorative images (dividers, background flourishes): use an empty alt,
alt="", so screen readers skip them. Do not omit the attribute. -
Images that are links or buttons: the alt text should describe the action ("Call us"), not the picture.
-
Dimensions: set
widthandheightto the image's intrinsic size (or use CSSaspect-ratio) and let CSS scale it withmax-width: 100%; height: auto;.
Platform-specific notes
- WordPress: set the "Alternative text" field in the media library; the block editor adds width and height automatically.
- Shopify: edit alt text per product image in the product admin.
Common mistakes
- "image", "photo" or the file name as alt text.
- Stuffing keywords into alt text.
How to check the fix worked
Inspect images in the browser and check each alt, width and height. Re-run the audit.
References and further reading
Related tutorials
Make pages display properly on phones (viewport meta tag)
Without a viewport tag, phones show your desktop layout zoomed out. One line in the page head fixes it, provid...
Label form fields, name icon links and declare the page language
Three quick accessibility fixes: every form field needs a label, every link needs readable text, and every pag...