Image Rules
Image Rules
Rules for validating image SEO and performance.
image-alt
Ensures all content images have descriptive alt text.
Checks
- All
<img>tags havealtattribute - Alt text is not empty
- Alt text is descriptive (not just "image" or "photo")
AI Enhancement
When AI is enabled, generates alt text by analyzing images.
Examples
Pass:
Fail (missing):
Fail (empty):
Fail (not descriptive):
Decorative Images
For purely decorative images, use empty alt:
Configuration
image-dimensions
Checks images specify width and height to prevent layout shift.
Checks
<img>tags havewidthattribute<img>tags haveheightattribute
Why It Matters
Without dimensions, the browser doesn't know how much space to reserve, causing Cumulative Layout Shift (CLS) when images load.
Examples
Pass:
Pass (CSS aspect-ratio):
Fail:
Configuration
image-lazy-load
Recommends lazy loading for below-the-fold images.
Checks
- Images not in first viewport have
loading="lazy" - Hero/above-fold images should NOT be lazy loaded
Examples
Pass (below fold):
Pass (above fold - no lazy):
Suggestion:
Configuration
image-format
Suggests modern image formats for better performance.
Checks
- Detects JPEG/PNG images
- Suggests WebP or AVIF alternatives
Examples
Suggestion:
Pass (modern format):
Best Practice (picture element):
Configuration
Best Practices
Alt Text Guidelines
| Image Type | Alt Text |
|---|---|
| Photos | Describe content: "Woman hiking in mountains" |
| Icons | Describe function: "Search" |
| Charts | Summarize data: "Sales increased 25% in Q4" |
| Decorative | Empty: alt="" |
| Logos | Company name: "Acme Inc logo" |
Performance Checklist
- All images have alt text
- Dimensions specified (prevent CLS)
- Below-fold images lazy loaded
- Modern formats (WebP/AVIF) where possible
- Responsive images with srcset
Example Optimized Image