Article summary
The alt attribute (alternative text) is an HTML tag that describes an image for search engines and screen readers. It should be concise, descriptive, and useful — never a keyword list or generic filler like "image." This guide covers what makes good alt text, how to write it with context, implementation in HTML and WordPress, special cases like SVGs and decorative images, and a practical accessibility checklist.
Let me break it down: the alt attribute (alternative text) is the HTML text that describes an image. Screen readers read it aloud for visually impaired users, and Google uses it to understand the image so it can rank it in Google Images. Keep it concise, descriptive, and only include your main keyword when it fits naturally.
What Is the Alt Image Attribute?
As you can see in the screenshot I took from my own website, the alt attribute sits inside the <img> tag and gives the image a text alternative. If the image fails to load, the browser displays this text. Screen readers read it aloud so people who can’t see the image still get the content. Google uses it to understand what the image is about and rank it in Google Images.

<img src="example.jpg" alt="A landscape with mountains and a lake on a sunny day">Why it matters:
- Accessibility: screen readers depend on it. Without alt text, visually impaired users miss the content entirely.
- SEO: it’s a direct signal for Google Images.
- UX: when an image breaks, the alt text tells visitors what should be there.
Why Alt Text Matters: SEO & Accessibility
The alt attribute serves two masters at once. For accessibility, it’s non-negotiable: screen readers announce it so users who can’t see the image still understand the page. For SEO, it’s one of the strongest signals for ranking in Google Images. I’ve seen product pages jump in image search just by swapping generic alts for specific, keyword-aware descriptions. And when an image fails to load, the alt text becomes the fallback, which is better than a broken icon and a file name.
How to Write Good Alt Text: Context Is Key
Context changes everything. A product photo on a category page needs different alt text than the same photo in a blog review. Ask yourself: what does this image add to this specific page?
Bad vs. good examples:
- ❌
image of Xbox→ ✅Xbox Series X console in carbon black - ❌
chart showing traffic→ ✅Organic traffic growth chart: 40% increase over six months - ❌
photo of red dress→ ✅Red midi wrap dress with floral print, size M
The pattern: subject + key detail + relevant attribute. That extra context helps Google Images match the right search intent.
What I’ve tested and what worked:
- Remove “image of,” “photo of” and “picture of.” They waste characters, and the alt attribute is inherently for an image.
- Front-load the primary keyword when it describes the image honestly.
- A/B tests adding the category and key specs (VRAM, model, color) moved the needle in Google Images.
- My rule of thumb is around 90 characters. There is no official limit, so don’t pad it to reach a number.
Key Characteristics of Good Alt Text
- Accurate and relevant: it describes what’s actually in the image, in the context of the page.
- Unique: don’t copy and paste the same alt across multiple images.
- Concise: keep it tight; around 90 characters is my rule of thumb, and no official limit exists.
- Keyword-aware: include your target keyword when it fits naturally, never forced. See my keyword research guide for finding the right terms.
- Clear language: no misleading or vague descriptions.
- Readable by humans and bots: write for people first; search engines follow.
- Updated when content changes: if the image or the page context shifts, update the alt.
Implementing Alt Attributes in HTML & WordPress
Raw HTML
Just add alt="your description" to every <img> tag. No exceptions for content images.
WordPress (Media Library)
- Log in and go to Media → Library.
- Click the image you want to edit.
- In the Alternative Text field, enter your alt text.
- Click Save.
WordPress (Block Editor / Gutenberg)
- Select the Image block in the editor.
- In the right sidebar, under Block → Image settings, find Alt text (alternative text).
- Type your description.
- Update the post.
Common mistake: the alt is filled in the Media Library, but each Image block keeps its own copy. Changing it in the library later doesn’t update posts where the image is already inserted. Check the block-level field when the image is used in a specific context, because that’s the one Google sees on that page. For more on how Google uses this, see its Google Images documentation.
Special Cases: Functional Images, Buttons & Icons
| Image type | Alt treatment | Example |
|---|---|---|
| Image links | Describe the destination, not the image | alt="View pricing plans", not alt="Blue button with arrow" |
| Icon fonts / SVGs as icons | <svg> doesn’t support alt. Use role="img" + aria-label="meaning", or hide it with aria-hidden="true" next to a visible label | role="img" aria-label="Shopping cart" |
| Decorative images | Use alt="" (empty) so screen readers skip it. This is not the same as omitting the attribute | alt="" for a spacer GIF or a background pattern |
For the full decision tree on decorative vs. informative images, see the W3C Images Tutorial.
Alt vs. Title Attribute: What’s the Difference?
| Attribute | Purpose | Shown to users | SEO weight |
|---|---|---|---|
alt | Accessibility + image understanding | Screen readers, broken-image placeholder | High |
title | Advisory tooltip | Mouse hover (desktop only) | Little to none |
The title attribute is not a substitute for alt. Use alt for everything that matters, and title only if you genuinely need a tooltip.
Practical Accessibility Checklist for Alt Text
- A screen reader announces it and it makes sense in context
- Empty (
alt="") for purely decorative images - No keyword stuffing: it reads like a sentence, not a tag list
- Functional images (links, buttons) describe the action or destination
- Unique per image, with no duplicates across the site
- Updated when the image or the page context changes
This isn’t a full WCAG audit, just the practical checks that catch most issues.
Check the Alt Text on Your Own Site
Want to see which images on a page are missing alt text? The El Joseo SEO extension flags them in seconds, on any URL.
Sources and further reading
Frequently asked questions
How do I add alt text to an image in HTML?
Add alt="your description" inside the <img> tag: <img src="photo.jpg" alt="Red running shoes on white background">.
What does alt text do for accessibility?
Screen readers read the alt text aloud so visually impaired users understand the image’s content and function.
How long should alt text be?
Keep it concise. My rule of thumb is around 90 characters, and there is no official limit. Focus on relevance, not on a character count.
Should I put keywords in alt text?
Only when they honestly describe the image. Forced keywords hurt accessibility and can look like spam.
What about decorative images?
Use alt="" (an empty string) so screen readers skip them entirely.
Does alt text help with Google Images ranking?
Yes. It’s a primary signal Google uses to understand and rank images. Pair it with good file names and surrounding context.
What's the difference between the alt and title attributes?
alt is for accessibility and SEO; title is a tooltip on hover with little to no SEO value. They serve different purposes.
If you’d like a second pair of eyes on your site’s images and on-page SEO, try the free SEO audit.



