Start with an automated scan to generate a complete list of violations:
# Using pa11y-ci to crawl a sitemap
pa11y-ci --sitemap https://yoursite.com/sitemap.xml \
--reporter json \
| jq '[.[] | select(.issues[].code == "WCAG2AA.Principle1.Guideline1_1.1_1_1.H37")]'
You can't fix everything at once. Prioritize images in this order:
See how 321 websites scored →
View the 2026 Reportalt="" and are quick to mark-- Find all images with empty or missing alt text in WordPress SELECT ID, post_content FROM wp_posts WHERE post_type = 'attachment' AND post_mime_type LIKE 'image/%' AND (post_excerpt = '' OR post_excerpt IS NULL) LIMIT 100;
# Shopify Admin API — update product image alt text
curl -X PUT \
"https://YOUR-STORE.myshopify.com/admin/api/2024-01/products/PRODUCT_ID/images/IMAGE_ID.json" \
-H "X-Shopify-Access-Token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"image": {"alt": "Blue cotton t-shirt in size medium"}}'
For sites with hundreds or thousands of product images, manually writing alt text is impractical. Options:
// Example: batch generate alt text using the Gemini API
const { GoogleGenerativeAI } = require('@google/generative-ai');
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
const model = genAI.getGenerativeModel({ model: 'gemini-pro-vision' });
async function generateAltText(imageUrl) {
const response = await model.generateContent([
'Write a concise alt text description for this product image. ' +
'Focus on what the product looks like, key features visible, and ' +
'any text in the image. Under 125 characters. No "image of" prefix.',
{ inlineData: { mimeType: 'image/jpeg', data: await fetchBase64(imageUrl) } }
]);
return response.response.text().trim();
}
Always review AI-generated alt text before publishing. AI can miss product names, colors, or key details.
// CI check: fail build if new images lack alt text
const { axe } = require('axe-core');
const violations = results.violations.filter(v => v.id === 'image-alt');
if (violations.length > 0) {
console.error('FAIL: Images missing alt text:', violations[0].nodes.length);
process.exit(1);
}
Accessalyze scans your pages and lists every image without adequate alt text. Free, instant results.
Find Missing Alt Text →← Back to Accessalyze · ← How to Write Alt Text
See real website accessibility scores: Browse 244+ free accessibility audits →
Try it yourself
Enter your website URL to get a free accessibility score.