# Missing Alt Attribute: Error Explained and Fixed

Source: https://allyway.ai/glossary/missing-alt-attribute

A missing alt attribute means an img element (or an image button or image map area) has no alt attribute at all. Assistive technology cannot tell whether the image is informative or decorative and may read out the file name instead.

A missing alt attribute is the scanner error for an image tag that has no `alt` attribute at all. It is reported as "Image missing alt attribute" or "Images must have alternate text". This page is about the error itself – how to write good descriptions is covered in the [alt text](https://allyway.ai/glossary/alt-text) guide.

## What it means

The `alt` attribute is how an image tells screen readers what it shows. When the attribute is missing completely, assistive technology has no information: it cannot know if the image matters or is just decoration. Screen readers may then fall back to the file name – and "IMG_4711.jpg" or "hero-banner-final-2.webp" is read aloud instead of real content.

[WCAG 1.1.1 Non-text Content](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html) is a Level A criterion of [WCAG 2.2](https://allyway.ai/regulations/wcag-2-2): all non-text content needs a text alternative that serves the equivalent purpose, and purely decorative images must be hidden from assistive technology. W3C lists "omitting the alt attribute or text alternative on img elements, area elements, and input elements of type image" as failure F65. File names or placeholder text used as alt text are a failure too (F30).

| Markup | What the scanner says | What it means |
|---|---|---|
| `<img src="team.jpg">` | **Missing alt attribute** | No information at all – fix it |
| `<img src="line.svg" alt="">` | No error | Decorative, correctly ignored |
| `<img src="team.jpg" alt="Our team of five at the office">` | No error | Informative, described |
| `<img src="team.jpg" alt="IMG_4711.jpg">` | Often no error | Fails 1.1.1 anyway (F30) |

> **Warning:** > **Missing is not the same as empty**
> `alt=""` is a deliberate decision: "this image is decorative, skip it". No `alt` at all means nobody decided – which is why scanners flag it as an error.

## Examples

The error often hides in product images, logos and images inside links. When the image is the only content of a link or button, the missing alt also creates an [empty link](https://allyway.ai/glossary/empty-link) or [empty button](https://allyway.ai/glossary/empty-button).

```html title="Example"
<!-- Error: no alt attribute -->
<img src="/images/sneaker-red.jpg">

<!-- Fixed: informative image -->
<img src="/images/sneaker-red.jpg" alt="Red running sneaker, side view">

<!-- Fixed: decorative image -->
<img src="/images/divider.svg" alt="">
```

**Do:** Do

Decide for every image: informative → describe its content or purpose; decorative → `alt=""`. Set alt text in your CMS media library, so it is used wherever the image appears.

**Don't:** Don't

Leave the attribute out, fill it with the file name, or write "image" or "spacer" for decorative images – W3C counts that as a failure (F39).

## How to fix a missing alt attribute



Online shops are hit hardest, because every product photo counts. In [Shopify](https://allyway.ai/integrations/shopify-accessibility-integration) and [WooCommerce on WordPress](https://allyway.ai/integrations/wordpress-accessibility-integration), alt text can be set per image in the media or product settings.

## Questions

Q: What does "image missing alt attribute" mean?
A: The `<img>` tag has no `alt` attribute at all. Screen readers have no text alternative and may read out the file name instead.

Q: Is alt="" the same as a missing alt attribute?
A: No. `alt=""` marks an image as decorative so screen readers skip it – that is correct for decoration. A missing attribute is an error, because nobody decided whether the image matters.

Q: Do decorative images need an alt attribute?
A: Yes, an empty one: `alt=""`. Leaving it out fails WCAG 1.1.1; W3C lists this as failure F65.

Q: How do I find images without alt attributes?
A: Run the [free WCAG scanner](https://allyway.ai/free-wcag-accessibility-scanner-for-websites) on your homepage. For a single image, right-click it and choose *Inspect* to see whether the attribute exists.

Q: Can allyWay fix missing alt attributes automatically?
A: Yes. allyWay's AI looks at your images and writes alt texts that describe what is actually in them, then applies them on every page. The [automatic fixes](https://allyway.ai/automatic-accessibility-fixes-for-website) run through the allyWay script, so your CMS, theme and files stay as they are, and every fix is logged. [Start for free](https://app.allyway.ai/register) and give your images text alternatives without editing them one by one.
