HomeFix guides → All <img> tags have alt attribute

tech

How to fix: All <img> tags have alt attribute

Why this matters

Alt text provides crawlers with context for images and is a minor ranking signal for image and web search. It's also a WCAG 1.1.1 accessibility requirement — every <img> needs an alt attribute (empty string for purely decorative images).

Background

Alt text provides crawlers with context for images and is a minor ranking signal for image + web search. Also WCAG 1.1.1 accessibility requirement.

References

WCAG 1.1.1 · Google Image Search guidance

How to fix

Code snippet for each stack we cover. Pick the one matching your server / framework.

nginx
No server config — content edit.
apache
Same.
cloudflare
Same.
wordpress
Yoast SEO has an 'add missing alt text' bulk-edit feature. Otherwise edit each image in Media Library.
flask
Template-level: pass alt= explicitly when rendering <img>. Lint via accessibility tools (axe-core).
express
Same.
rails
Same — use image_tag with explicit alt.

Verify it's working

Browser devtools: `document.querySelectorAll('img:not([alt])').length` — should be 0.

Want to know if your site has this issue?

Run a free 53-check audit — security, GDPR, NIS2, and technical SEO.

Audit my site →