All images have alt attributes

high

images_alt_text

Checks that all images have alt attributes.

What does this rule check?

The alt attribute provides alternative text for images when they cannot be displayed, and is read by screen readers for visually impaired users. It also helps search engines understand image content for image search rankings.

Why is this important?

Missing alt text hurts accessibility (WCAG violation), prevents search engines from understanding images, and loses image SEO opportunities. Alt text is a legal requirement in many jurisdictions.

How to fix

Add descriptive alt text to every image. Use empty alt="" only for purely decorative images. Describe what the image shows, not what it is.

Examples

Incorrect
<img src="shoe.jpg" />
<!-- No alt attribute at all -->
Correct
<img src="shoe.jpg" alt="Red Nike running shoe with white sole on a trail" />

Agent fix snippet

Copy this snippet and paste it into your AI coding agent to fix this issue automatically.

Find all <img> tags missing alt attributes:

document.querySelectorAll('img:not([alt])')

Add descriptive alt text. Use alt="" for decorative images.