Generating alt text at scale with AI in n8n: SEO and accessibility
Published 19 August 2026 · 5 min read
On an e-commerce catalog with a few thousand SKUs, or a site that's been live for several years, it's common for 60 to 80% of images to have no alt attribute at all, or a generic one (IMG_4821.jpg, "image", the raw filename). Two concrete consequences follow: those images are invisible to Google Images and to screen readers, and since June 28, 2025 the European Accessibility Act makes this a WCAG non-compliance point for any company past 10 employees or €2M in revenue. Writing these texts one by one in the CMS editor takes hours on a mid-sized site — exactly the kind of task n8n can automate by combining a vision model, a quality check, and the CMS's API.
Automating this isn't the same as handing the whole thing to AI without review, though. A recent study presented at the Web for All conference, Cardia, Angileri, Poggianti and Leporini (W4A, 2026) — see on Google Scholar, compares human-written alt text to LLM-generated text on technical images (charts, diagrams, formulas): model-produced descriptions read fluently but leave substantial gaps in structural detail and the formal semantics that screen reader users actually rely on. For product photos or illustrative visuals, AI is plenty; for images carrying structured information, that finding justifies a human checkpoint before publishing rather than full automation.
Pipeline overview
The workflow has five steps: finding images with unusable alt text, sending them to a vision model, constrained generation, a quality check that routes sensitive cases, then republishing via the CMS API.
List images (CMS / sitemap) → Filter (empty or generic alt) → Vision AI (+ product context) → Quality check → IF (ok / needs review) → Publish via API
Step 1 — Finding images with unusable alt text
On WordPress (WooCommerce included, since it relies on the same media library), an HTTP Request node queries the native REST API:
GET /wp-json/wp/v2/media?media_type=image&per_page=100&page=1
Every object returned includes an alt_text field — unlike the Yoast SEO fields covered in our guide to AI-generated meta descriptions, this field is directly writable through the standard API, with no plugin or extra PHP snippet required. On Shopify, the equivalent goes through the GraphQL Admin API (product.media, with an alt field on each MediaImage).
A Filter node then keeps only the images that need work:
const alt = ($json.alt_text || "").trim().toLowerCase();
const filename = ($json.source_url || "").split("/").pop().replace(/\.\w+$/, "");
return [{
json: {
...$json,
needsFix:
alt === "" ||
alt === filename.toLowerCase() ||
/^(image|photo|img|dsc|screenshot)[\s_-]*\d*$/i.test(alt),
},
}];
An image with alt text that's already written and matches the image is never touched — only empty or clearly generic images pass the filter.
Step 2 — Sending the image to a vision model
The principle mirrors our guide to multimodal vision analysis: an HTTP Request node (or the OpenAI node's Analyze Image operation) fetches the binary, and an upstream Edit Image node downsizes it to 1000-1500px wide to keep cost down — alt text needs no fine detail, unlike text extraction from a document. On a product catalog, feeding the title, category, and listing attributes (already covered in our guide to AI-generated product listings) into the prompt keeps the model from guessing what it's looking at from the image alone.
Step 3 — Generating with strict constraints
A Chain LLM node with a Structured Output Parser enforces a fixed schema:
{
"alt_text": "string, max 125 characters, factual description without 'image of' or 'photo of'"
}
The prompt should explicitly ban generic filler ("Image showing..."), repeating the page title, and keyword stuffing — a screen reader reads the alt attribute word for word, and an artificial-sounding phrase is immediately audible.
Step 4 — Quality check and routing
const d = $json;
const issues = [];
if (!d.alt_text || d.alt_text.length > 125) issues.push("length out of range");
if (/^(image|photo) (of|showing)/i.test(d.alt_text)) {
issues.push("generic filler detected");
}
if (d.imageCategory === "chart" || d.imageCategory === "diagram") {
issues.push("structural image — human review required");
}
return [{ json: { ...d, ok: issues.length === 0, issues } }];
An IF node splits compliant images (published directly) from cases that need review — empty, generic, or flagged upstream as charts/diagrams. The human approval with Wait and Slack pattern lets you route these to a review queue instead of blocking them outright.
Step 5 — Republishing via the API
| CMS | Endpoint | Field |
|---|---|---|
| WordPress / WooCommerce | POST /wp-json/wp/v2/media/{id} |
alt_text |
| Shopify | productUpdateMedia (GraphQL Admin) |
alt on MediaImage |
| PrestaShop | PUT /api/images/products/{id} |
legend (via the XML webservice) |
On WordPress, writing only needs Basic Auth with an application password — no extra configuration, unlike third-party SEO fields. On Shopify, the GraphQL mutation takes the product ID and an array of {id, alt} objects matching the media already attached; our Shopify and WooCommerce guides cover the matching authentication.
Processing the catalog in batches
On several thousand images, a Loop Over Items node processes batches of 20 to 50 with a short Wait between each, as covered in our guide to n8n loops and our guide to API rate limits. This is also the point to log every change — image, old and new alt text, date — into a Supabase table, following the same principle as our guide to a GDPR audit trail, so you never reprocess an image already fixed and can produce a history if an accessibility check comes up.
Summary
Generating alt text at scale in n8n rests on the same guardrails as SEO content generation: target only images that are genuinely empty or generic, feed the model product context rather than the image alone, enforce structured output with strict length bounds, and route structural images to human review instead of automating everything. That same foundation — extraction, constrained generation, quality control, logging — also powers the document-tracking workflows in the RAG Assistant Pack (€119), built to turn a raw corpus of images and documents into structured, usable content.
FAQ
Frequently asked questions
Is AI-generated alt text enough to be compliant with accessibility regulations like the European Accessibility Act?
It covers most of the ground — the majority of non-compliant images simply have an empty alt attribute, not an absurd one. But for images carrying structural information (charts, diagrams, screenshots of tables), an AI vision model still falls short of a human-written description, as shown by a recent study on LLM-generated alt text. Routing those cases to a human review step instead of fully automating them remains the safer practice for this specific image type.
Should the same alt text serve both SEO and accessibility?
The goal is the same — accurately describing what the image shows — but the angle differs slightly. Good accessible alt text describes what a sighted user would perceive, without added value judgment; good SEO alt text naturally includes the relevant keyword or product context when it genuinely matches the image. A single, well-written text without keyword stuffing usually serves both goals at once.
How do you avoid regenerating alt text that's already present and correct?
By filtering upstream on images whose alt attribute is empty, generic ("image", "photo", the raw filename) or clearly truncated, rather than reprocessing every image on the site. Alt text that's already hand-written and consistent with the image is never overwritten, unless you explicitly force a full regeneration.
Bundle FlowKit Complet
€269