/ โ† Image Optimisation Fixes / Decorative Images
In this guide
  1. Why ornamental images cause problems twice
  2. Deciding which side of the line an image is on
  3. The fix, step by step
  4. Before and after markup
  5. Which marker to use, and which to avoid
  6. The performance side: what moving decoration changes
  7. Where decorative images come from on common platforms
  8. Edge cases
  9. Keeping decoration light and silent
  10. Questions and answers

Why ornamental images cause problems twice

A decorative image is one that a visitor would not miss if it vanished. It sets a tone or fills space, but it carries no fact, instruction or action. The trouble starts when the markup does not say so. An <img> element with no alt attribute, or with a meaningless value such as alt="image" or alt="bg-swirl-2", gives a screen reader something to read aloud. Someone listening to your page hears a string of noise between the headings they actually wanted.

The second problem is less often discussed. Every <img> in the HTML is found by the browser's preload scanner as soon as the markup arrives, and it joins the queue of downloads alongside your product photos, your fonts and your scripts. A page with a dozen ornamental images in the first screen is asking the browser to spend bandwidth on flourishes before it has finished the picture that actually sells something. On a slow mobile connection that competition is real.

So the fix has two halves that support each other:

The writing of good descriptions for meaningful images is a separate job, covered in our alt text guide. This page stays with the other side of the line: things that should say nothing and weigh little.

Deciding which side of the line an image is on

The same picture can be decorative on one page and essential on another. A photograph of a sunlit kitchen is ornament on a plumber's contact page and the whole point on a kitchen fitter's portfolio. Judge each image in its context, not by what it depicts.

ImageUsuallyWhy
Background texture, gradient, pattern or blob shapeDecorativePure styling with no content.
Divider line, corner flourish, bullet graphicDecorativeVisual structure that the HTML already expresses.
Icon beside a text label (a phone icon next to "Call us")DecorativeThe words already say everything the icon says.
Icon on its own inside a button or linkNot decorativeIt is the only label the control has.
Generic stock photo in a blog headerOften decorativeIf the article makes sense without it, treat it as mood.
Product photo, chart, map, diagram, screenshotContentA visitor would lose information without it.
Logo in the header linking homeContentIt is a link and needs a name.
Photo next to a caption that fully describes itEitherIf the caption says it all, the image can stay silent.

When in doubt, ask whether a sighted visitor would complain if the image were replaced by a blank space the same size. If the honest answer is "no, it just looks nicer", it is decorative.

โš ๏ธ An image that is the only content of a link or button is never decorative, however small. If you give it alt="", the link has no accessible name at all and a screen reader will announce it as just "link", or read out the URL.

The fix, step by step

Step 1

Inventory the images on each template

Work template by template rather than page by page, because ornaments almost always come from the theme, header, footer or a page builder block. Open a representative page, run the Image Optimisation audit, and in developer tools filter the Network panel to images. Note every file that loads, where it appears, its transfer size and whether it is an img element, an inline SVG or a CSS background. A spreadsheet with one row per image keeps the next steps quick.

Step 2

Apply the removal test to each one

For each row, imagine the image replaced by an empty box of the same size and ask whether a visitor loses any fact, instruction or way to act. Mark it content if they would, decorative if they would not, and functional if it is the only thing inside a link or button. Be strict with stock photos and hero backgrounds: most exist to create a mood. Anything marked content leaves this guide and goes to your alt text work.

Step 3

Replace ornaments with CSS where you can

Before deciding how to hide a decorative file, ask whether it needs to be a file at all. Divider lines become a border-top, soft glows become box-shadow, colour washes become linear-gradient() or radial-gradient(), rounded frames become border-radius, and simple arrows or chevrons can be drawn with borders or a short SVG. Each replacement removes an HTTP request and some bytes, and because nothing is in the HTML, there is nothing for a screen reader to announce.

Step 4

Move remaining decoration into CSS backgrounds

Photographic textures and patterns that must stay as bitmaps belong in the stylesheet as a background-image, not in the HTML as an img. Screen readers ignore CSS backgrounds, and the browser only requests them once the stylesheet has been parsed and the element is found to be visible, so they no longer compete with content images at the start of the load. Use image-set() to offer WebP or AVIF with a JPEG fallback, and keep each file sized for the largest box it fills.

Step 5

Hide inline SVG icons from assistive technology

For icons drawn as inline SVG next to a visible label, add aria-hidden="true" to the svg element so it is skipped, and remove any title element inside it that would otherwise be read. Add focusable="false" if you still support very old Internet Explorer or legacy Edge builds. If you use an icon sprite, reference symbols with use so the browser downloads one cached file instead of dozens of separate icon images.

Step 6

Mark decorative img elements that must stay

Some decorative images have to remain as img elements, for example when a content editor places them in a CMS body. Give each one an explicitly empty alt="" with nothing between the quotes, not even a space. Keep width and height so the space is reserved, add loading="lazy" if it sits below the first screen, and add decoding="async". Never give a decorative image fetchpriority="high"; that priority belongs to the main content image.

Step 7

Recheck bytes, requests and screen reader output

Reload the page with the cache disabled and compare the number of image requests and total image bytes with the figures from step one. Then listen to the page with NVDA, VoiceOver or TalkBack, moving through it with the arrow keys, and confirm that no ornament is announced while every product photo, chart and linked logo still is. Finally run the Image Optimisation audit again so the decorative items no longer appear among its findings.

Before and after markup

The examples below come from a fictional joinery firm, Oakline Joinery, whose home page had grown a collection of ornaments over several redesigns.

A divider graphic

<!-- Before: a 14 KB PNG with a meaningless alt -->
<img src="/img/divider-gold.png" alt="divider">

<!-- After: no file, no request, nothing announced -->
<hr class="rule-gold">

.rule-gold {
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #b8893b, transparent);
  margin: 2rem auto;
  max-width: 12rem;
}

A styled <hr> is a thematic break, which some screen readers announce as a separator. If the line is purely ornamental and not a change of topic, use a div or a ::before pseudo-element instead.

A textured section background

<!-- Before: absolutely positioned img behind the text -->
<section class="about">
  <img src="/img/wood-grain.jpg" alt="wood grain" class="about-bg">
  <h2>Made in our Derbyshire workshop</h2>
</section>

<!-- After: CSS background with modern formats -->
<section class="about">
  <h2>Made in our Derbyshire workshop</h2>
</section>

.about {
  background-color: #6b4a2b;
  background-image: url("/img/wood-grain-1600.jpg");
  background-image: image-set(
    url("/img/wood-grain-1600.avif") type("image/avif"),
    url("/img/wood-grain-1600.webp") type("image/webp"),
    url("/img/wood-grain-1600.jpg") type("image/jpeg"));
  background-size: cover;
}

The plain background-image line comes first as a fallback for browsers that do not understand image-set() with type(). The solid background-color keeps the heading readable while the texture loads or if it fails.

An icon next to a label

<a href="tel:+441234567890" class="call">
  <svg aria-hidden="true" width="20" height="20" viewBox="0 0 24 24">
    <use href="/img/icons.svg#phone"></use>
  </svg>
  Call the workshop
</a>

An icon that is the whole button

<button type="button" class="menu-toggle" aria-label="Open menu">
  <svg aria-hidden="true" width="24" height="24" viewBox="0 0 24 24">
    <use href="/img/icons.svg#menu"></use>
  </svg>
</button>

In the last example the SVG itself is still hidden, but the button carries its name with aria-label. The icon is decorative; the control is not.

Which marker to use, and which to avoid

There are several ways to tell assistive technology to ignore something. They are not interchangeable, and stacking them rarely helps.

Things to avoid:

The performance side: what moving decoration changes

Moving an ornament from an img to a CSS background does more than silence it. It changes when and whether the file is downloaded.

โš ๏ธ A full-width hero photograph behind the headline is often the page's Largest Contentful Paint element, even when it is decorative. Moving it into CSS delays its discovery and can make LCP worse. For that one image, either keep it as an img with alt="" and fetchpriority="high", or preload it with <link rel="preload" as="image">. Our LCP guide explains the timing in detail.

Decorative images also tend to be the least carefully exported files on a site, because nobody checks them. A background texture saved as a 3 MB PNG straight from a design tool is common. Once you have decided an image is ornament, it is worth being ruthless: lower quality settings and heavy blur often go unnoticed on a texture that sits behind text.

Where decorative images come from on common platforms

WordPress

In the block editor, the Image block's alternative text field carries a hint to leave it empty if the image is decorative, and an empty field outputs alt="". The Cover block renders its background image as an img with empty alt by default, which is correct for decoration but means it is still fetched early. Theme ornaments are usually in the theme's CSS or template parts, so a child theme is the safe place to change them.

Shopify

Themes built on Online Store 2.0 often expose decorative images as section settings. The image_tag Liquid filter accepts an alt parameter, so a theme developer can pass an empty value for section backgrounds. Check apps too: badge and trust-seal apps frequently inject small images with generic alt values.

Page builders

Elementor, Divi and similar builders let you set images either as an image widget or as a section background. Prefer the background option for ornaments, and check the output, because some builders add wrapper images or placeholder GIFs of their own.

React and other frameworks

Icon libraries such as those used with React usually render inline SVG. Most set aria-hidden="true" by default when no title is passed, but confirm it in the rendered HTML rather than assuming. In JSX, write alt="" explicitly; omitting the prop produces an image with no alt attribute, and linters such as eslint-plugin-jsx-a11y will flag it.

Edge cases

Keeping decoration light and silent

Questions and answers

1. How do I know if an image is decorative or not?

Ask what a visitor would lose if the image disappeared and left an empty space. If they would lose a fact, an instruction, a product detail or the ability to click something, it is content or functional and needs a description. If they would only lose some atmosphere, it is decorative. Judge in context: the same photograph can be ornament on one page and essential on another, depending on whether the surrounding text already covers what it shows.

2. Is it better to use alt="" or a CSS background for decorative images?

Both hide the image from screen readers, so the choice is mostly about performance and maintenance. CSS backgrounds keep ornaments out of the HTML, load after content images, and are usually skipped when their element is hidden. An img with empty alt is easier for editors to manage in a CMS and can be lazy-loaded natively. For theme ornaments prefer CSS; for images editors place in content, an img with empty alt is fine.

3. Does aria-hidden work on img elements?

It does hide an img from assistive technology, but it is the wrong tool for that job. An empty alt attribute is simpler, better supported and is what accessibility guidance recommends for decorative images. Keep aria-hidden for inline SVG icons, icon font elements and wrappers that contain only decoration. Never use it on anything that contains a link, button or form field, because keyboard users could still reach those controls while screen reader users would not know they exist.

4. Will decorative images with empty alt hurt my SEO?

No. Empty alt on a genuinely decorative image is correct markup and search engines do not penalise it. The image simply contributes nothing to understanding the page, which is accurate. What can hurt is filling decorative alt attributes with keywords, which makes the page worse for screen reader users and has no clear benefit. Put your effort into good descriptions for product photos, charts and other images that carry real information, where alt text matters.

5. Why does my audit still flag images I have marked as decorative?

Check the rendered HTML, not the editor. A common cause is alt with a space between the quotes, or a CMS that replaces an empty field with the file name or post title on output. Another is a plugin or page builder that adds its own wrapper image. Findings about file size, format or dimensions are separate from alt text, so a decorative image can still be flagged for being heavier than it needs to be.

6. Can a decorative hero image affect Largest Contentful Paint?

Yes. LCP measures the largest image or text block visible when the page loads, regardless of whether it carries meaning. A full-width background photograph behind the headline is often that element. If you move it into CSS, the browser finds it later and LCP can get slower. Keep it as an img with empty alt and high fetch priority, or preload it, and make sure the file is compressed and sized for the screen.

7. Should social media and payment icons in the footer have alt text?

It depends on whether they are links. A row of social icons that link to your profiles are functional, so each link needs a name such as the network name, given through the image alt or an aria-label on the link. Payment logos that are not links are usually decorative when a line of text already says which payment methods you accept; if no text says so, they carry information and need short descriptions.

Find the images that are costing you for nothing

The Image Optimisation audit checks every image on your page for file size, format, dimensions, alt text, lazy-loading, layout shift and CDN delivery, and ranks its recommendations by their effect on loading and bandwidth.

Open Image Optimisation Fixes โ†’
๐Ÿ’ฌ Got a problem?
Related Guides: All Image Optimisation Fixes  ·  Fixing Missing or Poor Alt Text  ·  Fixing Lazy Loading  ·  Image Optimisation Guide  ·  Learning Hub

About aiwebpageseo

aiwebpageseo.com is a data-driven SEO and AEO (Answer Engine Optimisation) platform providing a free suite of technical SEO tools. Rather than relying on AI-theorised assumptions, the platform analyses live URL performance, delivering objective diagnostics, page speed metrics, CLS debugging, and site crawl data alongside actionable technical tutorials.