The `alt` attribute, commonly known as alt text, is a fundamental part of image optimization. Its primary purpose is to provide a text alternative for an image for screen reader users. However, it also provides crucial context to search engines. A missing alt attribute is a technical error where the `alt` attribute is completely absent from an `<img>` tag. This is a critical issue for both web accessibility and SEO.
It’s important to distinguish between a missing attribute and an empty one. An empty attribute (`alt`) is a valid way to signal that an image is purely decorative. A missing attribute is an error that can cause screen readers to read out the entire, often messy, image file name. For a broader look at image optimization, see our guide on the images category.
>
Why a Missing Alt Attribute is a Problem
Failing to include an `alt` attribute on your images is a significant mistake. As Google’s own documentation makes clear, alt text is a key part of optimizing images.
- Poor Accessibility: It creates a frustrating experience for visually impaired users who rely on screen readers to understand the content of your images.
- Lost SEO Value: You lose a valuable opportunity to provide context to search engines, which can help your images rank in Google Image Search and can also help your page rank for relevant keywords.
A Step-by-Step Guide to Finding and Fixing Missing Alt Attributes
The goal is to ensure that every `<img>` tag on your site has an `alt` attribute. For a deep dive into this topic, this guide from Ahrefs on alt text is an excellent resource.
Example: Fixing a Missing Alt Attribute
<!-- Before: Missing alt attribute -->
<img src="/puppy.jpg">
<!-- After: Descriptive alt attribute added -->
<img src="/puppy.jpg" alt="A golden retriever puppy playing with a red ball">
For more on this topic, see our guide on alt text over 100 characters.
Frequently Asked Questions
What is the difference between a missing alt attribute and an empty one?
A missing alt attribute (`<img>`) is an error. An empty alt attribute (`<img alt=””>`) is a valid way to tell screen readers that an image is purely decorative and can be ignored. You should fix missing attributes by either adding a description or, if the image is decorative, adding an empty alt attribute.
Is the image file name a substitute for alt text?
No. While you should use descriptive file names for your images, they are not a substitute for alt text. Screen readers do not read file names, and they provide less contextual information to search engines than a well-written alt attribute.
How can I find all the images with missing alt attributes on my site?
The most effective way is to use a website crawler like Creeper. It will scan every page on your site and provide a report of all images, specifically flagging any that are missing the alt attribute entirely.
Are your images invisible to some users? Start your Creeper audit today to find and fix all images with missing alt attributes.