Auto Dimensions

Reduce layout shifts by adding missing width and height attributes

Images without width and height attributes cause layout shifts — the page jumps around as images load and the browser figures out their size. This hurts your Core Web Vitals score (specifically CLS — Cumulative Layout Shift).

Compresso can automatically add these attributes to images that are missing them.

Enabling Auto Dimensions

Go to Compresso > Settings and enable Auto Dimensions. It's disabled by default.

Once enabled, Compresso scans images in your page content, thumbnails, widgets, and avatars. If an image is missing width or height, Compresso reads the file dimensions and adds them.

External Images

By default, Compresso only processes images hosted on your site. Enable Include external images to also add dimensions to images loaded from other domains.

Dimensions are cached after the first lookup, so there's no performance penalty on repeat page views.

When to Use This

Enable auto dimensions if:

  • Your CLS score in Google PageSpeed Insights is above 0.1
  • You see images causing visible layout jumps on your pages
  • Your theme or page builder doesn't set image dimensions consistently

This feature works well alongside lazy loading — dimensions ensure the browser reserves the correct space before the lazy image loads.

On this page