DEV Community

Cover image for Decorative Image Alt Text in WordPress: Do It Right
Benjamin Oats
Benjamin Oats

Posted on • Originally published at oppti.dev

Decorative Image Alt Text in WordPress: Do It Right

Decorative Image Alt Text in WordPress: Do It Right

Decorative image alt text is the part of accessibility that most guides get backwards. The usual advice is "add alt text to every image", so people dutifully describe the divider lines, background flourishes, and corner swooshes on their WordPress site. That's the wrong move. A decorative image should have empty alt text, so a screen reader skips it entirely.

Get this wrong in either direction and you hurt the people alt text is meant to help. Describe a meaningless swirl and a screen reader user has to sit through "decorative purple swirl graphic" before reaching the actual content. Leave a decorative image with no alt attribute at all and some screen readers read out the file name instead. This post explains how to tell a decorative image from a meaningful one, and how to set empty alt text correctly in WordPress.

What counts as a decorative image

A decorative image adds nothing to the meaning of the page. If you removed it and replaced it with blank space, a reader would lose no information. Common examples on a WordPress site: section divider lines, background textures, corner ornaments, a spacer graphic, an icon sitting next to a text label that already says the same thing.

A meaningful image is the opposite. It carries information a reader needs — a product photo, a chart, a screenshot, a diagram, a photo that illustrates a point in the text. If removing it would leave the reader confused or missing something, it's meaningful and it needs real, descriptive alt text.

The grey area is usually icons. An icon that repeats adjacent text is decorative: a little envelope next to the word "Email" tells a screen reader user nothing they don't already have, so it should have empty alt. But an icon that is the only label — a bare envelope icon that's a clickable contact link with no visible text — is meaningful, and its alt text should say what it does, like "Email us".

Empty alt text vs no alt attribute

This distinction trips people up, so it's worth being precise. There are three states an image can be in:

  • alt="A forest green wool jumper" — descriptive alt text. Correct for meaningful images.
  • alt="" — an empty alt attribute. Correct for decorative images. It tells assistive technology "this image is intentionally decorative, skip it".
  • No alt attribute at all — a missing attribute. This is the broken state. Some screen readers fall back to reading the image's file name, so the user hears "IMG underscore 4471 dot jpg".

So decorative images should have an alt attribute that is present but empty. Present tells the screen reader you made a deliberate choice; empty tells it there's nothing to announce. The combination — alt="" — is what makes the image disappear cleanly from the accessibility tree. Missing the attribute entirely is the failure mode to avoid.

How to set empty alt text in WordPress

WordPress makes this straightforward once you know the field behaves the way you'd hope. Leaving the Alt Text field blank produces alt="", not a missing attribute, for images inserted through the block editor.

  1. Open the post or page in the block editor and select the image block for the decorative image.
  2. In the block settings sidebar on the right, find the "Alternative text" field.
  3. Leave it empty. Don't type a space, don't type "decorative" — an empty field is exactly what you want here.
  4. For images in the Media Library, open the attachment and confirm the "Alt Text" field is blank rather than holding a leftover description.
  5. Preview the page, view source, and check the decorative image shows alt="" in the HTML.
  6. If a theme or page builder added a background image via CSS instead of an <img> tag, you don't need to do anything — CSS background images aren't in the accessibility tree at all, which is the right place for purely decorative visuals.

One caveat: some older themes and page builders output no alt attribute when the field is empty, producing the broken missing-attribute state. That's why step five matters. If you find decorative images shipping without an alt attribute, that's a theme bug worth flagging, and a good reason to audit what your pages actually output rather than trusting the editor.

Why this matters for SEO too

There's an SEO angle people miss. Stuffing keywords into the alt text of decorative images doesn't help rankings and can read as manipulation. Google wants alt text that genuinely describes meaningful images; describing a divider line as "best WordPress SEO plugin divider" helps nobody and looks like keyword padding.

The reverse is the real win. When your decorative images correctly carry empty alt, the meaningful images stand out. Google's understanding of your page's images isn't diluted by descriptions of ornaments, and your image search relevance concentrates on the photos and graphics that actually matter. Accessibility and SEO point the same way here: describe what matters, stay silent on what doesn't.

Frequently asked questions

Should decorative images have empty alt text or no alt text?

Empty alt text — alt="" — is correct. The attribute should be present but hold no value. That combination tells a screen reader the image is intentionally decorative and can be skipped silently. An image with no alt attribute at all is a different, broken state: some screen readers respond by reading out the file name, which is exactly the noise you were trying to avoid. So the goal for a decorative image is a present-but-empty alt attribute, not a missing one.

How do I know if an image is decorative or meaningful?

Ask what a reader loses if the image is removed. If they lose information — a product looks different, a chart's data is gone, a point in the text no longer makes sense — the image is meaningful and needs descriptive alt text. If they lose nothing but a bit of visual polish, it's decorative and should have empty alt. Icons are the common edge case: if the icon repeats nearby text, it's decorative; if the icon is the only label for a link or button, it's meaningful and needs alt text describing the action.

Does empty alt text hurt my WordPress SEO?

No. Empty alt text on genuinely decorative images has no negative SEO effect, and it actually helps by keeping your meaningful images clear to search engines. Google doesn't expect every image on a page to be described; it expects descriptions where they add value. What does hurt is the opposite mistakes: leaving meaningful images with empty or missing alt, or padding decorative images with keywords. Set descriptive alt on content images and empty alt on decorative ones, and both accessibility and image SEO improve.

The short version

Not every image needs describing. Decorative images — dividers, textures, repeated icons — should carry an empty alt="" so screen readers skip them, while meaningful images get real descriptions. The one state to avoid everywhere is a missing alt attribute, which leaves screen readers reading file names.

If you want to see which of your images fall into which bucket, the free image SEO audit flags images with missing and empty alt across your site, and the OpptiAI Alt Text plugin writes descriptions for the meaningful ones so your effort lands where it counts.

Top comments (0)