Skip to main content

Assessments: Image alt attributes

The Image alt attributes assessment checks whether all assessed images have alt attributes. It only runs on product pages.

By default, it assesses the images in the text. A platform can limit all image assessments to the product's own images (featured, gallery, variations) by providing the providedImages attribute of the Paper. An empty array counts as a product without images.

Image alt attributes
Name in codeImageAltTagsAssessment
Title URLhttps://yoa.st/33c (set by Yoast WooCommerce SEO; the yoastseo default has no link)
Call to action URLhttps://yoa.st/33d (set by Yoast WooCommerce SEO; the yoastseo default has no link)
When it appliesAlways, on product pages.
ProductYoast WooCommerce SEO, Yoast SEO for Shopify
Content typesWordPress: products (WooCommerce SEO)
Shopify: products
Google Docs: not available
Related keyphrases❌
Uses synonyms❌
LanguagesAll languages
Cornerstone❌ Same scoring
Uses highlighting❌
Uses morphology (Premium)❌

Scoring​

These are the default feedback strings. WooCommerce SEO and Shopify supply their own strings (see Custom feedback strings), so the strings a user sees on a product page are different.

Traffic lightScoreCriterionFeedback
Red3No imagesImage alt attributes: This page does not have images with alt attributes. Add some!
Red3None of the images have alt attributes (also when there is only one image)Image alt attributes: None of the images have alt attributes. Add alt attributes to your images!
Red3One of several images has no alt attributeImage alt attributes: One image doesn't have alt attributes. Add alt attributes to your images!
Red3Not all images have alt attributesImage alt attributes: Some images don't have alt attributes. Add alt attributes to your images!
Green9All images have alt attributesImage alt attributes: All images have alt attributes. Good job!

Flagged items​

The result names the images without alt text in flaggedItems, each once, by their id, or else by their src. An image with neither is counted, but not named. An alt text of only whitespace counts as missing.

Custom feedback strings​

A platform can supply its own feedback strings through callbacks.getResultTexts. This callback receives urlTitleAnchorOpeningTag, urlActionAnchorOpeningTag, numberOfImagesWithoutAlt, totalNumberOfImages and isVariableProduct, and must return all four of good, noImagesBad, noneHasAltBad and someHaveAltBad. The returned object is used as is, so an omitted key renders as an empty result text. It does not fall back to the default.