What does Google say about SEO? /
Quick SEO Quiz

Test your SEO knowledge in 3 questions

Less than 30 seconds. Find out how much you really know about Google search.

🕒 ~30s 🎯 3 questions 📚 SEO Google

Official statement

To avoid content shifts and improve SEO, you must specify the width and height attributes directly in the HTML markup of the image. This simple practice helps prevent a negative signal from Google.
🎥 Source video

Extracted from a Google Search Central video

💬 EN 📅 22/06/2022 ✂ 3 statements
Watch on YouTube →
Other statements from this video 2
  1. Les images peuvent-elles vraiment faire grimper votre positionnement dans Google ?
  2. Pourquoi l'absence de dimensions d'image pénalise-t-elle votre classement Google ?
📅
Official statement from (3 years ago)
TL;DR

Google confirms that missing width and height attributes on images generate a negative SEO signal, primarily due to content shifts (CLS). Specifying these dimensions directly in HTML is not just a technical best practice — it's a ranking factor through Core Web Vitals.

What you need to understand

Why do width and height attributes impact SEO?

The answer comes down to three letters: CLS (Cumulative Layout Shift). When the browser loads a page without knowing the dimensions of images, it cannot reserve the necessary space. Result: content shifts abruptly when the image appears.

This phenomenon frustrates users, but more importantly — and this is what matters for us — it's part of the Core Web Vitals. Google measures these shifts and has integrated them into its ranking algorithm for several years. Alan Kent says it plainly: failing to specify these attributes generates a negative signal.

What's the difference between CSS and HTML attributes?

Many developers define image dimensions only in CSS. The problem? The browser must first download and parse the CSS before knowing these dimensions. During this delay — even if brief — the space isn't reserved.

With width and height attributes directly in the HTML, the browser instantly knows the dimensions, before even loading the CSS or the image. It can therefore reserve the correct space from the first render. It's this anticipation that prevents the shift.

Are all types of images affected?

Yes, without exception. Whether content images, product visuals, banners, or even logos — every <img> tag should have width and height attributes. Background CSS images are not subject to this specific recommendation.

  • The width and height attributes directly reduce CLS, one of the three Core Web Vitals
  • These attributes must be placed in the HTML, not just in CSS
  • The browser can reserve space before the image loads
  • This practice applies to all img tags on the site
  • The absence of these attributes constitutes a negative signal for Google

SEO Expert opinion

Does this statement really change anything?

Let's be honest: this recommendation isn't new. HTML specs have existed for decades, and web performance best practices have hammered this point since Core Web Vitals arrived. What changes is the explicit confirmation that this is a negative SEO signal.

In the field, we observe a clear correlation between well-ranked sites and low CLS scores. But be careful — correlation is not causation. CLS is just one factor among hundreds. A site with perfect CLS but mediocre content will never outrank a relevant competitor.

How much impact should you expect?

That's where it gets tricky. Google never quantifies the relative weight of its ranking factors. Alan Kent speaks of a "negative signal," but without specifying its intensity. [To verify]: Are we talking about a micro-penalty or a real competitive disadvantage?

A/B tests conducted on e-commerce sites generally show modest gains — rarely more than a few positions on already well-worked queries. Impact is more visible on technically neglected sites where CLS explodes. But if your direct competitors have already optimized this point, fixing it simply brings you to parity.

Caution: Don't sacrifice responsive design for the sake of HTML attributes. The dimensions must be the intrinsic dimensions of the image (its actual size), not its display size. CSS then handles adaptation to different screens.

In which cases does this rule create problems?

Dynamically loaded images via JavaScript raise questions. If you use a custom lazy loading system or a framework that injects images on the client side, specifying width and height becomes more complex — but remains possible with the right techniques.

Images whose proportions vary by context (art direction, contextual cropping) also require a more sophisticated approach, often via <picture> and srcset. In these cases, each source must have its own dimensions specified.

Practical impact and recommendations

What should you do concretely on an existing site?

First step: audit your CLS via Google Search Console, "Core Web Vitals" section. If you're in the red or orange, images without dimensions are probably the culprit. PageSpeed Insights details exactly which images are causing layout shift.

Next comes the technical work. On a static site or standard CMS, adding width and height is generally simple — it's mainly tedious if you have thousands of images. On WordPress, plugins like Perfmatters or WP Rocket can automate this for new images.

For sites with dynamically generated content, your backend needs to calculate and inject these attributes when generating HTML. This often means storing image metadata in a database or calculating it on the fly — an operation that can slow the server if poorly optimized.

What errors should you avoid during implementation?

Classic mistake: putting made-up dimensions just to satisfy the audit tool. If you specify width="500" height="300" when the image is actually 1200×800, the browser will need to recalculate — and potentially create layout shift anyway.

Another pitfall: forgetting images with lazy loading. Even an image that loads late should have its dimensions specified, otherwise it will cause a shift when it appears in the viewport.

  • Audit current CLS via Search Console and PageSpeed Insights
  • Identify all <img> tags without width/height attributes
  • Get the actual dimensions of each image (not CSS display dimensions)
  • Implement an automated solution for new uploads
  • Verify that responsive design still works correctly
  • Test on both mobile and desktop after deployment
  • Re-measure CLS after a few days to validate improvement

How do you measure real impact after correction?

Google Search Console updates its Core Web Vitals data with a 28-day delay. Don't expect to see changes immediately. Use real-time tools (Chrome DevTools, WebPageTest) to technically validate that CLS has decreased.

For rankings, track your positions on strategic queries before and after optimization. But isolating the specific impact of this change will be difficult — too many variables shift simultaneously. The key is confirming you haven't broken anything and that the overall trend remains positive.

Specifying width and height in HTML is a fundamental technical optimization, but it fits into a much broader ecosystem of improvements. For sites with complex architectures, dynamically generated images, or thousands of pages to correct, this task can quickly become time-consuming and require specialized technical expertise. In these situations, partnering with a specialized SEO agency allows you to not only deploy these optimizations properly, but also integrate them into a coherent global performance strategy.

❓ Frequently Asked Questions

Les attributs width et height ralentissent-ils le chargement de la page ?
Non, au contraire. Ces attributs ne rajoutent que quelques octets au HTML et permettent au navigateur de réserver l'espace immédiatement, évitant ainsi des recalculs coûteux pendant le rendu. C'est un gain net en performance.
Faut-il modifier les dimensions si l'image est redimensionnée en CSS ?
Non. Les attributs width et height doivent refléter les dimensions intrinsèques de l'image (sa taille réelle). Le CSS se charge ensuite de l'adapter à la mise en page. Le navigateur utilise le ratio pour réserver le bon espace.
Cette optimisation fonctionne-t-elle pour les images en lazy loading ?
Oui, et c'est même encore plus crucial. Une image en lazy loading sans dimensions spécifiées provoquera un layout shift au moment où elle apparaît dans le viewport. Les attributs width/height sont indispensables pour éviter ce problème.
Que faire pour les images dont les proportions changent selon le device ?
Utilisez la balise <picture> avec plusieurs <source> ayant chacune leurs propres attributs width et height. Le navigateur choisira la bonne source et ses dimensions correspondantes selon le contexte.
Un site peut-il ranker sans ces attributs s'il a un excellent contenu ?
Oui, le contenu reste le facteur principal. Mais à contenu équivalent entre deux sites concurrents, celui qui a optimisé ses Core Web Vitals aura un avantage. C'est un différenciateur dans les secteurs compétitifs.
🏷 Related Topics
Domain Age & History Content Images & Videos

🎥 From the same video 2

Other SEO insights extracted from this same Google Search Central video · published on 22/06/2022

🎥 Watch the full video on YouTube →

Related statements

💬 Comments (0)

Be the first to comment.

2000 characters remaining
🔔

Get real-time analysis of the latest Google SEO declarations

Be the first to know every time a new official Google statement drops — with full expert analysis.

No spam. Unsubscribe in one click.