Add alt text to images

Alt text describes an image for people who cannot see it and for crawlers that cannot read pixels. Write what the image shows in context, keep it under about 125 characters, and use an empty alt for decorative images. Make alt text a required field on upload.

mediumIn codeimpact effort

Why this matters

Describe the image in context, not with keywords.

Get the full breakdown

The extended brief explains when this works, when it does not, and the trade-offs. Join the waitlist and it unlocks for every tip when sign-in opens; MCP access is the paid part.

Join the waitlist

Before you start

  • A crawl of rendered images
  • Access to the CMS image fields

How to apply it

  1. List images without alt text General best practice

    Crawl the site and export every img element with its src, alt value and page. Separate missing alt from empty alt, because decorative images should be empty.

    Check: The export distinguishes images with no alt attribute from those with alt="".

  2. Write contextual descriptions

    Describe each informative image in one sentence, including the detail that matters on that page. Keep decorative images empty and avoid duplicating adjacent captions.

    Check: Sampled informative images have unique alt text that is not a filename or keyword list.

  3. Require alt text on upload General best practice

    Make the CMS field required, or validate in the build that informative images have alt text. Fail the build on missing alt for content images.

    Check: Uploading an image without alt text is blocked or fails the build.

Get the prompt for your agent

A ready-to-paste prompt for your agent that implements this tip and verifies the result in your repo.

Join the waitlist

Source: seo-mcp playbook · curated entry · report an error

Framework notes

nextjs-app

`next/image` requires an `alt` prop; pass an empty string for decorative images so the attribute is explicit.

wordpress

The media library stores alt text in `_wp_attachment_image_alt`; themes should read it with `wp_get_attachment_image` rather than printing the filename.

Official references

Let your agent apply this + 161 more tips.

Pre-order — $19