WooCommerce Product Image Alt Text: Find the Missing Ones and Fix Them in Bulk

Most WooCommerce stores have hundreds of product photos and alt text on a handful of them. Products get imported from a CSV, a supplier feed or a migration, and the images arrive with no description at all. This guide shows where WooCommerce keeps that text, how to list every product photo that is missing it, what good product alt text looks like, and how to fill the gaps without editing images one by one.

Why product photos are the alt text that matters most

Where WooCommerce stores product image alt text

WooCommerce does not have its own alt field. Product images are ordinary WordPress media attachments, and the alt lives on the attachment, in the post meta key _wp_attachment_image_alt. The product only points at its images:

ImageWhere the product references it
Main product image_thumbnail_id meta on the product
Product gallery_product_image_gallery meta on the product (comma-separated attachment IDs)
Variation image_thumbnail_id meta on each product_variation post

Two consequences people trip over:

How to list every product image missing alt text

With SQL (phpMyAdmin, Adminer or wp db query; replace wp_ with your table prefix). Main images of published products with no alt, or an empty one:

SELECT p.ID AS product_id, p.post_title AS product, a.ID AS image_id, a.guid AS image_url
FROM wp_posts p
JOIN wp_postmeta t ON t.post_id = p.ID AND t.meta_key = '_thumbnail_id'
JOIN wp_posts a ON a.ID = t.meta_value
LEFT JOIN wp_postmeta alt ON alt.post_id = a.ID AND alt.meta_key = '_wp_attachment_image_alt'
WHERE p.post_type = 'product' AND p.post_status = 'publish'
  AND (alt.meta_value IS NULL OR TRIM(alt.meta_value) = '');

Change 'product' to 'product_variation' for variation images. Gallery images are a comma-separated list, so they are easier to check from the media side.

With WP-CLI, every image in the Media Library that has never had an alt saved:

wp post list --post_type=attachment --post_mime_type=image \
  --meta_key=_wp_attachment_image_alt --meta_compare="NOT EXISTS" \
  --fields=ID,post_title,post_parent --format=table

This catches images with no alt meta at all, which is what imports usually produce. An alt that was saved and later cleared is stored as an empty string and needs the SQL version above. post_parent shows the product an image was first uploaded to, when there is one.

8 examples: bad vs good WooCommerce product alt text

#The imageBad altGood altWhy
1Main image of a hoodie product, front viewhoodie-front-v2-final.jpgOrganic cotton zip hoodie in forest green, front viewThe file name is what many themes fall back to. Product, material and color are what the shopper checks.
2Variation image for the "Sand" color of the same hoodieOrganic cotton zip hoodie in forest green, front viewOrganic cotton zip hoodie in Sand, front viewCopying the main alt to every variation tells a screen-reader user all colors look the same. Use the variation name as the store spells it.
3Gallery photo: the hoodie's inside label and seamshoodieInside of the hoodie: brushed fleece lining and flat-locked seamsEach gallery image exists to show something new. Describe that, not the product again.
4Product photo of a 1 kg bag of coffee beanscoffee beans buy coffee online best coffee shop1 kg bag of Ethiopia Yirgacheffe whole coffee beans, resealable kraft pouchKeyword lists are read aloud word for word and look like spam to search engines. Size and packaging are real product facts.
5Size chart image attached to a T-shirtsize chartSize chart: S 46 cm, M 51 cm, L 56 cm, XL 61 cm chest width, measured flatText inside an image is invisible to screen readers. Put the data in the alt, or better, also as a table on the page.
6Bundle photo: a skincare set laid outgift setSkincare gift set: cleanser, toner, 50 ml moisturiser and a cotton pouchFor "what you get" photos the contents are the information.
7Lifestyle photo: a desk lamp on a cluttered home-office deskModern home office with laptop, plant, books, mug and lampBlack adjustable desk lamp lighting a laptop keyboard on a home-office deskDescribe the product you sell; mention the scene only as context.
8Close-up of a ring's engravingImage of ringClose-up of the inner band engraving in script lettering, sterling silverScreen readers already say "image". Close-ups are for detail, so give the detail.

More product photo cases are in alt text examples for product photos, and the general rule behind all of them in WCAG 1.1.1 alt text requirements.

Filling hundreds of product images in bulk

Writing these by hand works for twenty products, not for two thousand. Alt Text BYOK is a WordPress plugin that finds every image in the Media Library missing alt text and writes it with an AI vision model, using your own API key (OpenAI, Anthropic, Gemini, OpenRouter and others), so you pay the provider directly, cents per hundred images, with no subscription in between.

Check one product photo first

Upload a product photo to the free generator and see the alt it writes (3 images a day, no signup). Then let the plugin do the whole catalog.

Alt Text BYOK for WordPress Download the free version Try the free generator

Not sure how many images are missing? See WordPress images missing alt text for the store-wide check, including images outside WooCommerce.

← See all products

Terms · Privacy · Refunds (7-day money-back) · Contact