Skip to main content
SlapMyWeb

Accessibility fix

How to Add Alt Text to Images

Describe images with alt text for screen-reader users and image SEO.

Difficulty
Easy
Impact
Medium
Time
15 min

Before

<img src="chart.png">  <!-- no alt -->

After

<img src="chart.png" alt="Organic traffic grew from 1k to 8k visits over 6 months">
<img src="divider.svg" alt="">  <!-- decorative -->
Before and after code for: How to Add Alt Text to Images

Alt text is the description screen readers announce for an image and the text browsers show when it fails to load. Give every informative image a short, specific alt that says what it shows or does, and give purely decorative images an empty alt attribute so assistive technology skips them.

Why it matters

Alt text is read aloud by screen readers, shown when an image fails to load, and helps your images rank in Google Images. Informative images need a concise description; purely decorative images should have an empty alt="" so screen readers skip them.

How to fix it

  1. Describe informative images

    Write what the image conveys in context: concise and specific, no "image of…".
  2. Empty-alt the decorative ones

    Use alt="" (not a missing attribute) for purely decorative images so assistive tech ignores them.

The code

Beforehtml
<img src="chart.png">  <!-- no alt -->
Afterhtml
<img src="chart.png" alt="Organic traffic grew from 1k to 8k visits over 6 months">
<img src="divider.svg" alt="">  <!-- decorative -->

On your platform

WordPress

The Media Library has an "Alt text" field per image; fill it in before inserting. Bulk-edit older images with a plugin.

Next.js

next/image requires an alt prop: pass a real description or "" for decorative.

Sources

Fixed that one.
Now find the rest.

A free audit ranks every issue on your site by the score points it costs, and links each one straight to its guide.

Run a free audit
Free foreverNo signupLive scan progress
How to Add Alt Text to Images — Fix Guide | SlapMyWeb