/seo-audit-skills:image-optimizationfrom seo-audit-skills
Optimizes images for SEO and Core Web Vitals: format selection (WebP, AVIF, JPEG, PNG), responsive images with srcset/sizes, lazy loading, LCP optimization (fetchpriority, preload), compression targets, and CMS implementation (WordPress, PrestaShop).
Ships in seo-audit-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Images are 50-70% of page weight on most sites. They are also the most common LCP element. Wrong format, wrong loading strategy, or missing dimensions are among the top 5 CWV failure causes.
| Format | Best for | Browser support | Typical savings vs JPEG |
|---|---|---|---|
| JPEG | Photos, complex images | Universal | baseline |
| PNG | Graphics with transparency | Universal | baseline |
| WebP | Photos + graphics | 95%+ (2024) | 25-35% smaller |
| AVIF | Photos + graphics | 80%+ (2024) | 40-50% smaller |
| SVG | Icons, logos, illustrations | Universal | N/A (vector) |
Recommendation: Serve WebP as the default for all new images. Use AVIF where
browser support is acceptable and compression gains justify the encoding time.
Always keep JPEG/PNG as fallback via <picture>.
<!-- AVIF with WebP fallback and JPEG as final fallback -->
<picture>
<source srcset="hero.avif" type="image/avif">
<source srcset="hero.webp" type="image/webp">
<img src="hero.jpg" alt="Hero image description" width="1200" height="600"
loading="eager" fetchpriority="high">
</picture>
| Image type | Context | Target size |
|---|---|---|
| LCP hero | Above the fold, full-width | < 100 KB |
| Product image | E-commerce main image | < 150 KB |
| Blog featured image | Article header | < 80 KB |
| Thumbnail | Card, listing | < 30 KB |
| Icon / small graphic | < 50px | Use SVG or inline |
| Background texture | Decorative | < 50 KB |
Sizes above are for WebP. JPEG equivalents are approximately 30-40% larger.
Without responsive images, a mobile user downloads a 2400px-wide desktop image for a 390px-wide screen. This wastes bandwidth and delays LCP.
<img
src="product-800.jpg"
srcset="product-400.webp 400w,
product-800.webp 800w,
product-1200.webp 1200w,
product-1600.webp 1600w"
sizes="(max-width: 600px) 100vw,
(max-width: 1200px) 50vw,
800px"
alt="Product name"
width="800"
height="600"
loading="lazy">
sizes attribute explained: Tells the browser how wide the image will be
displayed before the CSS is parsed. This allows the browser to select the right
source from srcset during preload, before layout is known.
(max-width: 600px) 100vw → on screens < 600px, image is 100% of viewport width(max-width: 1200px) 50vw → on screens < 1200px, image is 50% of viewport width800px → on larger screens, image is always 800px wideMissing sizes attribute: The browser defaults to 100vw and downloads the
largest available image on all screen sizes. Equivalent to not using srcset.
The LCP image is the most important image on the page. Loading strategies that delay its discovery or download directly increase LCP.
Never loading="lazy" — lazy loading defers the fetch until the element
is near the viewport. For the LCP element, the element IS in the viewport.
Always fetchpriority="high" — signals to the browser that this image
should be fetched at high priority, ahead of other resources.
Add <link rel="preload"> in <head> — allows the browser to start
downloading the image before the HTML is parsed far enough to discover the <img> tag.
Only one fetchpriority="high" per page — setting it on multiple images
effectively cancels the priority signal.
<!-- In <head> -->
<link rel="preload" as="image"
href="/images/hero.webp"
imagesrcset="/images/hero-400.webp 400w, /images/hero-800.webp 800w"
imagesizes="(max-width: 600px) 100vw, 800px"
fetchpriority="high">
<!-- In <body> — the actual LCP image -->
<img src="/images/hero.webp"
srcset="/images/hero-400.webp 400w, /images/hero-800.webp 800w"
sizes="(max-width: 600px) 100vw, 800px"
alt="Hero description"
width="800" height="400"
loading="eager"
fetchpriority="high">
loading="lazy" is correct and recommended for all images below the fold.
It is incorrect and harmful on images above the fold (especially the LCP image).
loading="lazy"loading="lazy"fetchpriority="high"Elementor and WP Rocket apply lazy loading automatically to all images, including the LCP hero. This is the most common LCP failure in WordPress sites.
Elementor: The lazy load CSS hides backgrounds of sections 4+ and swaps
src with a placeholder. Fix: e-no-lazyload class on hero section.
WP Rocket: Replaces <img src> with data-lazy-src even if loading="eager"
or fetchpriority="high" is set in the HTML. Fix: exclude the hero image filename
in WP Rocket > Media > LazyLoad > Excluded images.
<!-- Correct: descriptive, with keyword where natural -->
<img src="limpieza-cristales-madrid.webp"
alt="Equipo de limpieza de cristales en fachada de edificio en Madrid"
width="800" height="533">
<!-- Wrong: keyword-stuffed -->
<img src="limpieza.webp" alt="limpieza limpieza cristales limpieza madrid limpieza profesional">
<!-- Wrong: empty alt on content image -->
<img src="team.jpg" alt="">
<!-- Correct: decorative image (pure visual) has empty alt -->
<img src="divider-wave.svg" alt="" role="presentation">
Rules:
<img>): alt=""alt="Company name logo"SEO impact: Alt text is used by Google to understand image content and as a ranking signal for image search. It is also a mandatory WCAG accessibility requirement.
Google documents how to tell it which image represents the page (section "Specify a preferred image with metadata", added 02/03/2026, https://developers.google.com/search/docs/appearance/google-images, read 20/11/2026):
primaryImageOfPage with a URL or ImageObject, or the image of the
page's main entity (via mainEntity / mainEntityOfPage).og:image meta tag.Audit findings that come from this:
og:image on every page (usually the logo or a sitewide banner, set as
the SEO plugin's default). It tells Google the preferred image of every URL is the logo.og:image and schema pointing to different images on the same page: pick one.og:image is a promo banner with text instead of the
product or dish photo.Missing width and height attributes on images cause layout shifts (CLS) when
the image loads and the browser reflows the page to accommodate the image dimensions.
<!-- Causes CLS: browser does not know height before image loads -->
<img src="product.jpg" alt="Product">
<!-- No CLS: browser reserves exact space -->
<img src="product.jpg" alt="Product" width="600" height="400">
CSS alternative:
img {
aspect-ratio: 3 / 2; /* matches 600x400 ratio */
width: 100%;
height: auto;
}
Both approaches are valid. The aspect-ratio CSS approach is more flexible for
responsive images where the intrinsic size varies.
<img> tag| CSS background-image | <img> tag | |
|---|---|---|
| Discoverable by preload scanner | No | Yes |
| Lazy loadable | Via Intersection Observer JS | Native loading="lazy" |
| Accessible (alt text) | No | Yes |
fetchpriority support | No | Yes |
| CLS prevention (dimensions) | Via aspect-ratio or min-height | width + height attributes |
Rule: Use <img> for content images. Use CSS background-image for
decorative backgrounds that have no informational value.
If a hero background-image must remain as CSS, add a manual preload:
<link rel="preload" as="image" href="/images/hero-bg.webp" fetchpriority="high">
ShortPixel (recommended):
Smush:
Imagify:
WP Rocket + Imagify: WP Rocket has native integration with Imagify for on-the-fly WebP conversion via CDN rewriting.
PrestaShop regenerates thumbnails from original uploads. Large originals are stored and thumbnails generated per context (product list, product page, email).
Fix for large originals: reduce upload quality before uploading, or use a module that compresses originals on upload.
PrestaShop thumbnail configuration: Back Office > Design > Image Settings. Regenerate thumbnails after changing sizes.
Elementor Pro's "Image" widget has an "Attributes" field. It is common to see
fetchpriority="high" applied manually to a decorative divider or separator
icon instead of the hero image. Check that fetchpriority="high" is on the
visually largest above-the-fold element.
WordPress automatically creates a public page for each uploaded image at
/domain.com/attachment/filename-of-image/. These pages have thin content
(just the image) and should be redirected or set to noindex.
Fix in Yoast: SEO > Search Appearance > Media > Redirect attachment URLs to the attachment itself: Yes.
PrestaShop uses the product name as the alt text for product images by default. This is often acceptable, but adding specific descriptive alt text per image improves both SEO and accessibility.
The alt text for product images can be set per image in Catalog > Products > Images tab.
WooCommerce product gallery images after the first are lazy-loaded by WooCommerce
and WP themes. This is correct behavior — they are not visible until the user
interacts with the gallery. The main product image should be loading="eager".
Hover zoom (the magnified view follows the cursor) takes control away from the shopper: the zoom can't be held on the part they want to read (label, ingredients, certification marks), it disappears when the cursor moves toward the price or the buy button, and it does not work on mobile, touch or keyboard (WCAG 1.4.13, content on hover or focus). If the product page doesn't let people see the product, they go back to the results page or don't buy.
When auditing or proposing a gallery, recommend user-controlled zoom: opens on click or tap, shows the image large, zooms with buttons, wheel or pinch, pans by dragging, stays open until closed, and loads the large file only when opened (no extra weight on page load). Report an existing hover zoom as a UX problem that hurts conversion and interaction signals. Do not sell it as a direct ranking factor beyond Core Web Vitals.
curl -s https://example.com/ \
| grep -oE 'https?://[^"]+\.(jpg|jpeg|png|webp|gif)' \
| xargs -I {} curl -s -o /dev/null -w "%{size_download} %{url_effective}\n" {} \
| awk '$1 > 204800 {printf "%.2f KB - %s\n", $1/1024, $2}' \
| sort -nr
What it does: Fetches the HTML of a URL, extracts all image URLs, measures each image's actual download size, and lists those exceeding 200 KB sorted by size descending.
Variants:
# Lower threshold — flag images > 100 KB (recommended for LCP candidates)
awk '$1 > 102400 {printf "%.2f KB - %s\n", $1/1024, $2}'
# All images regardless of size (full inventory)
awk '{printf "%.2f KB - %s\n", $1/1024, $2}' | sort -nr
# Save to file for reporting
| tee ~/claude-seo/client/image-audit-$(date +%Y%m%d).txt
Limitations:
When a site has missing or generic alt text, use Claude's vision capability to analyze the actual image and generate contextually correct alt text.
URL: https://example.com/images/foto1.jpg
Alt propuesto: [descripción natural con keyword y localización si aplica]
Nombre de archivo sugerido: keyword-descripcion-ciudad.webp
Observaciones: [si hay problema de relevancia, duplicado, o imagen decorativa]
alt="" — no textalt="Nombre de empresa logo"limpieza-cristales-madrid.webpfoto1.jpg → equipo-fisioterapia-barcelona.webp.webp, max 100 KBURL: https://clinica.es/wp-content/uploads/equipo.jpg
Análisis visual: foto grupal de 4 profesionales con batas blancas en consulta
Contexto página: clínica de fisioterapia en Valencia
Alt propuesto: Equipo de fisioterapeutas de la clínica en Valencia
Nombre sugerido: equipo-fisioterapeutas-valencia.webp
CRITICAL (LCP impact)
[ ] LCP image: NOT lazy-loaded (no loading="lazy", no data-src placeholder)
[ ] LCP image: has fetchpriority="high"
[ ] LCP image: < 100 KB
[ ] LCP image: served as WebP or AVIF (not JPEG/PNG if avoidable)
HIGH (CLS and performance)
[ ] All content images have explicit width + height (or aspect-ratio CSS)
[ ] Images below the fold use loading="lazy"
[ ] No images > 500 KB on any page (PSI "Properly size images")
[ ] Responsive srcset present on images > 400px wide
[ ] Hero image NOT served as CSS background-image (or preload link present)
MEDIUM (SEO and accessibility)
[ ] All content images have meaningful alt text
[ ] Decorative images have alt="" (empty alt, not missing)
[ ] No keyword-stuffed alt text
[ ] WordPress attachment pages redirected or noindexed
[ ] Product images in e-commerce have descriptive alt text
LOW (optimization)
[ ] WebP/AVIF served to supported browsers
[ ] Image CDN or compression plugin active
[ ] No images loaded unnecessarily on mobile (art direction via <picture>)
[ ] Thumbnails correct size (not oversized images scaled down with CSS)
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
image-optimization, core-web-vitals, lcp, responsive-images, webp, avif
Other plugins' skills for the same job
Generated from the plugin's indexed repository (carlosuhart/seo-audit-skills) — no native marketplace selected
npx claudepluginhub p/uhartharper-seo-audit-skills46 skills in this plugin
/accesibilidad-wcagAuditoría de accesibilidad web contra WCAG 2.2 AA sobre sitios en vivo: axe-core 4.14 en escritorio, móvil y estados (menú, diálogo, formulario con errores sin enviar nada), recorrido real de teclado (foco visible por píxeles, foco tapado por cookies o cabecera fija, foco en contenido oculto, trampas, enlace de salto), reflow a 320 px, zoom 200%, espaciado 1.4.12 y árbol de accesibilidad; consolidación por criterio con severidad, confianza y patrón, protocolo manual con lector de pantalla y contexto legal fechado (EAA, España, ADA, Chile, Brasil). Use when user says "accesibilidad", "auditoría de accesibilidad", "WCAG", "es accesible", "lector de pantalla", "navegación con teclado", "contraste", "European Accessibility Act", "a11y" o "accessibility audit". No para revisar usabilidad general (ux-heuristica), velocidad (core-web-vitals) ni preparación para agentes de IA (seo-agentic), aunque las cita.
/ads-asistentes-iaEvalúa la publicidad dentro de asistentes de IA para un cliente: qué plataformas venden anuncios hoy (ChatGPT Ads, anuncios en Google AI Overviews y AI Mode, Microsoft Copilot, Amazon Alexa for Shopping) y cuáles no (Perplexity, Gemini, Meta AI, Grok), elegibilidad por país e idioma, encaje por tipo de negocio (B2B, SaaS, e-commerce, local), forma de compra y presupuesto, medición en GA4 y Ads, riesgos y coordinación con SEO y GEO. Entrega un informe de evaluación con escenarios y piloto propuesto. Use when user says "anuncios en ChatGPT", "publicidad en IA", "publicidad en asistentes de IA", "ads en AI Mode", "anuncios en AI Overviews", "Perplexity ads", "Copilot ads", "ChatGPT Ads", "AI ads", "advertising in AI assistants" or "¿conviene invertir en anuncios en IA?". Not for organic AI citations (seo-geo), generic Google or Meta campaign management (paid-ads) or ad copy production (ad-creative).
/cache-headersCache architecture for SEO: Cache-Control, CDN vs browser cache, ETag and Last-Modified, and CMS setups (WP Rocket, LiteSpeed, PrestaShop, Nginx/Apache). Use for TTFB issues, caching layers or cache header audits.
/canonicalAuditoría e implementación de canonical: self-referencing, paginación, parámetros, conflictos con hreflang, cadenas, canonicals heredados y bugs por CMS (Yoast, Rank Math, WooCommerce, PrestaShop), incluido el canonical como causa de problemas de indexación o canibalización.
/ccpaAuditoría CCPA/CPRA (California): umbrales de aplicación, 8 derechos del consumidor, opt-out y contratos con proveedores, con informe de score y sanciones en USD. Sub-skill de /privacidad, también invocable sola.
/core-web-vitalsCore Web Vitals diagnosis and fixes (LCP, CLS, INP, TTFB): field vs lab data, CrUX, a diagnostic tree per metric and fixes for WordPress (Divi, Elementor, WP Rocket), PrestaShop and Shopify. Use for CWV scores or performance issues.