Images: Missing Size Attributes

back to issues overview

Missing Size Attributes

Image elements without dimensions (width and height size attributes) specified in the HTML.

This can cause large layout shifts as the page loads and be frustrating experience for users. It is one of the major reasons that contributes to a high Cumulative Layout Shift (CLS).

How to Analyse in the SEO Spider

View URLs with this issue in the ‘Images’ tab and ‘Missing Size Attributes’ filter, and export all URLs using the ‘Export’ button.

Click the address of the image and then the ‘Image Details’ tab in the lower window pane to view which pages have the image on them, and have missing width and height size attributes.

The column ‘Dimensions in Attributes (WxH)’ will be blank for any that are missing.

Export them in bulk via ‘Bulk Export > Images > Missing Size Attributes’.

What Triggers This Issue

This issue is triggered when image elements on a page lack specified dimensions (width and height size attributes) in the HTML. For example:

<img src="/example.jpg">

Where width and height are not defined.

Here’s how images should should appear in the HTML with width and height attributes.

<img src="/example.jpg" width="300" height="600">

How To Fix

Define all images native size using width and height attributes in the HTML.

This allows the browser to calculate enough space for the image before it loads avoiding large layout shifts.

Further Reading

Back to top