Skip to main content
Get early access

Free to join. Just your email.

WordPress SEO

updated GreatCompany

More customers from Google and ChatGPT?

Join the waitlist. Your free report shows what to improve on your site and who ChatGPT mentions instead of you.

Free reportNo payment details for your reportOpening in the US soon

Alt text: how to write it well, and how to let AI do it for all your images

Alt text is a short description of an image in the code of your page. A screen reader reads it out, and Google understands better what the image shows. You do not see it on your site, unless the image fails to load. In the HTML it looks like this: <img src="cassette.jpg" alt="Shimano Deore cassette, 12-speed, 10-51 teeth">.

This article is part of our guide to SEO for your WordPress site.

What is alt text for?

Alt text has two readers: people who cannot see your image, and search engines. People who are blind or have low vision have the page read out by a screen reader. Is there no alt attribute on an image? Then some screen readers read out the file name, the W3C writes. Your customer hears “IMG underscore 4032 dot jpg”.

Google looks at the alt text, at what image recognition sees and at the content of the page. That is how Google understands what an image is about, according to Google’s documentation on images. If you use an image as a link, the alt text also counts as the anchor text of that link. For an online store that counts double: your product photos can bring visitors through Google Images.

Alt tag or alt text?

Same thing. “Alt tag” is everyday language; technically alt is an attribute of the img tag. In WordPress the field is called Alternative Text. We write alt text, but if you search Google for alt tag, you mean exactly this.

The rules in plain language

The W3C, the organization behind web standards, has an extensive guide to images. Translated into what you need to know as a business owner, we arrive at seven rules:

  1. Describe what the image means on this page. You do not need to name everything in it. The W3C gives a handy test. Imagine reading the page over the phone to someone who needs to understand it. What do you say at the photo?
  2. Keep it short. The W3C asks for the shortest possible description of the image’s purpose. Our rule of thumb: one sentence, usually 5 to 15 words.
  3. Do not start with “image of” or “photo of”. According to the W3C tips, words like image, icon or photo are usually redundant.
  4. If the image is a link or button, describe what it does. A magnifying glass in your search bar gets the alt text “Search”. Your logo that links to the homepage gets your business name plus “home”.
  5. If there is text in the image, include that text. Better still: put that text on the page as plain text. Then everyone can read it, Google too.
  6. If the image is pure decoration, leave the alt text empty. Empty means alt="": the attribute is there, without text. More on that below.
  7. No keyword lists. Google writes that alt attributes stuffed with keywords create a bad experience and can make your site look like spam.

A bonus rule from Google: give your files a short, descriptive name. black-kitten.jpg says more than IMG00023.JPG.

Twelve examples: wrong versus right

The rules only become concrete when you apply them to real images. These are situations on almost every small business site.

Situation Wrong Right
Bike parts store, product photo cassette bike cassette buy cheap cassette Shimano Deore cassette, 12-speed, 10-51 teeth
Same store, second gallery photo IMG_2231 Back of the cassette showing the hub interface
Store, magnifying glass in the search bar magnifying glass Search
Home builder in Boise, project photo addition Boise builder addition New addition with sliding glass doors on a 1930s home in Boise
Home builder, logo top left linking to the homepage logo Miller Builders, home
Restaurant in Portland, photo of a dish food Grilled sea bass with fennel and beurre blanc
Restaurant, patio mood photo next to the heading “Our patio on the river” patio restaurant Portland Empty: the text next to it already says it
Restaurant, lunch menu as a JPG menu Lunch menu; also put the dishes and prices on the page as text
Hair salon in Austin, photo after the treatment hair salon austin balayage salon Shoulder-length brown hair with honey blonde balayage
Hair salon, Instagram icon in the footer icon Studio Lane on Instagram
Bookkeeping firm in Omaha, team photo bookkeeping firm omaha The Smith Bookkeeping team in front of the Omaha office
Bookkeeping firm, stock photo of a handshake above a blog post Two businessmen in suits shaking hands over a desk with a laptop Empty: the photo adds nothing

Two patterns stand out. The wrong versions are either a string of keywords or a description of a picture that tells nobody anything. The right versions say what a customer would miss if they could not see the photo, and nothing more.

Decorative images: when do you leave alt text empty?

Leave the alt text empty if the image adds nothing to what the text already says. Think of a divider, a mood photo in the header or a stock photo above a blog post. The W3C names exactly these cases in its explanation of decorative images, along with the photo whose content is already described by the text next to it.

An empty alt is different from no alt. With alt="" a screen reader skips the image. Without an alt attribute it may start reading out the file name. In WordPress you simply leave the Alternative Text field empty. In the image block you can also mark the image as decorative, according to the WordPress documentation on the image block.

We advise against giving stock photos a long description anyway just to fit in a keyword. It brings nothing in Google. And someone with a screen reader hears a whole sentence at every photo that tells them nothing.

Where do you fill in alt text in WordPress?

In two places: in the media library and in the image block on the page itself. The two are not linked. That difference explains why many sites still have images without alt text after a big cleanup.

In the media library

Go to Media, open the library and click an image. On the right is the Alternative Text field. What you fill in here is the default for every time you insert that image somewhere later.

In the image block

Click the image in the editor and open the block settings on the right. There is a field for alternative text there too. The WordPress documentation is clear: alt text you fill in the block only applies to the image on that one page or post.

Why that difference matters

When inserting, the block copies the alt text from the media library. If you change the media library afterwards, nothing changes in posts where the image already sits. WordPress contributors have confirmed this is by design.

Where is the image? Which alt text counts? Where do you change it?
Featured image of a post Usually the one from the media library Media library
Product photo in most WooCommerce themes Usually the one from the media library Media library
Image in the text of a page or post The one in the block In the block, per page

WordPress usually shows featured images and product photos with a function that reads the alt text from the media library when the page loads. So if you fill in 300 alt texts in the media library, your product pages benefit right away. Your blog posts do not yet. Always check: open the page, right-click, choose “View page source” and search for alt=.

Does the law require alt text?

In the US, there is no federal regulation that spells out web accessibility rules for private businesses, but the Department of Justice has long held that the Americans with Disabilities Act applies to the websites of businesses open to the public. In practice, courts and settlements usually point to WCAG as the yardstick, and digital accessibility lawsuits under the ADA run into the thousands every year, many of them against online stores. The DOJ’s 2024 rule for state and local governments sets WCAG 2.1 level AA as the standard for their sites.

The very first checkpoint in WCAG is about exactly this: success criterion 1.1.1 Non-text Content at level A. All non-text content must have a text alternative. Missing alt text is one of the most common findings in accessibility audits and complaints. Do you also sell to customers in the European Union? Then the European Accessibility Act, in force since June 28, 2025, can apply to your online store as well.

This is general information, not legal advice. Whether and how the rules apply to your business is a question for a lawyer.

Having AI write alt text: what goes wrong?

AI writes fine first drafts. But if AI only looks at the photo, it goes wrong in a few predictable places.

It describes the photo, not the purpose. A model sees “a man in work pants next to a wooden window frame”. On your home builder’s project page it should say that your carpenter is installing the windows of an addition.

It invents details. Brand, model, color and number of teeth are often guessed wrong, especially if the same photo is shared across three product variants. A mistake in alt text goes unnoticed by everyone except the customer with a screen reader.

It describes everything, including decoration. A stock photo gets thirty words, a divider gets “abstract blue waves”. That should have stayed empty.

It stuffs in keywords. Put “SEO” in your prompt and you get “buy bike parts” in every alt text, including the team photo. Exactly what Google advises against.

It starts with “Image of”. Redundant, according to the W3C.

And then there is the fallback that is not AI: the file name. Rank Math has a free option that fills in missing alt text. By default it uses the file name, and only when the page loads: in your media library the field stays empty. That is in Rank Math’s explanation of Image SEO. With files like dsc-0042-copy.jpg that produces alt texts nobody can use. So do not turn that on with the default setting.

What does work is giving context. Give the AI, per image, the page title, the product name and the variant. Also give the paragraph around the image. And these four rules: one sentence, no “image of”, no keyword lists, and empty if the photo adds nothing. More on good prompts for AI is in our article on AI content that sounds human.

Tackling hundreds of images at once

Standard WordPress has no button to edit alt text in bulk. With this approach you get through a large site too, without nonsense landing on your pages.

  1. Map what is missing, per place. Separate images without alt text in the media library from images without alt text in your posts. Those are two lists, because they are two places.
  2. Sort by importance. Product photos and images on pages that get visitors first. A 2017 blog post without traffic comes last.
  3. Mark everything decorative first. Those are the fastest decisions, and they prevent AI from inventing a story for them later.
  4. Let AI make a first draft, with context, in batches of 50. Small batches keep your review manageable.
  5. Check a sample of 20 per batch. If you find more than two with an invented detail, adjust your instruction and run the batch again.
  6. Apply the texts in both places. In the media library for product photos and featured images, in the blocks for images in your texts.
  7. Agree on a rule for new uploads. Whoever uploads a photo fills in the alt text right away, or marks it as decorative.

Working on your images anyway? Look at the rest of your page at the same time. A good meta description and smart internal links often bring in more clicks than your images. You handle them in the same round.

How GreatCompany handles it for you

With Automatic, GreatCompany prepares up to 5 improvements for your WordPress site every Monday and applies them. Alt text is part of that Monday round, next to titles, descriptions and internal links.

Also read what you can leave to software in your SEO.

With AI-written text in particular, you want to stay in control. A text you do not like is undone with one click. Want to see everything before it goes live? Then every proposal comes to your inbox first, and you choose Yes or No.

An example at the bike parts store: the product photo of a cassette had nothing. After the Monday round it says “Shimano Deore cassette, 12-speed, 10-51 teeth”. What Automatic does exactly is in WordPress SEO on autopilot.

Prefer to do it yourself with a plugin? Read which WordPress SEO plugins do what with images and metadata. And to see what else your site can gain, start with improve your SEO.

Frequently asked questions

How long can alt text be?
There is no fixed maximum. The W3C asks for the shortest possible description of the image's purpose. A good rule of thumb is one sentence of 5 to 15 words. If an image needs more explanation, such as a chart, put that explanation in the text on the page.
Does every image need alt text?
Every image needs an alt attribute. A description is only needed if the image adds something. A mood photo or decorative element gets an empty alt, so a screen reader skips it. If you leave the attribute out entirely, some screen readers read out the file name.
What is the difference between an alt tag and alt text?
There is none: alt tag is the common everyday term for the same thing. Technically, alt is an attribute of the img tag. In WordPress the field is called Alternative Text.
Is alt text the same as the caption in WordPress?
No. The caption is visible under the image, for everyone. Alt text is invisible and replaces the image for people who cannot see it. Do not repeat the caption word for word in the alt text, or someone with a screen reader hears it twice.
Can I let AI write alt text?
Yes, if you give the AI context: the page title, the product name and the paragraph around the image. Working from the pixels alone, AI invents details and also describes decorative photos. Always check a sample before you push hundreds of texts at once.

See whether ChatGPT mentions your business.

Join the waitlist. When GreatCompany opens in the US, you get your first report right away: who ChatGPT recommends in your market and what to improve on your site.

Free to join. When we open in the US, your free AI visibility report is first in line.

Curious what AI crawlers see on your site? About the technical scanPro $49, you do it yourself · Or automate your SEO for $99, built for WordPress

Opening in the US

Be first when GreatCompany opens.

Leave your email and website. When we open, you get your free AI visibility report first: which customer questions ChatGPT mentions you for, who it names instead, and what to fix first.

Free. One email when we open, nothing else. By joining you accept our Terms and Privacy policy.