Skip to content
Nazmul Nikhil
Menu

SVG Elements With an img Role Do Not Have an Accessible Text Alternative (PageSpeed Insights)

PageSpeed flags inline SVGs marked as images that have no title or label. Here's how to label them or hide decorative ones.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 1 min read
SVG Elements With an img Role Do Not Have an Accessible Text Alternative (PageSpeed Insights)
Photo: Paul Skorupskas on Unsplash

In short

An inline <svg role="img"> tells assistive technology "this is an image," so it needs a name, just like an <img> needs alt text. Add aria-label or a <title> as the first child. If the SVG is decorative, use aria-hidden="true" and drop role="img". This is a best-practice check outside Google's weighted scoring table.

<svg role="img" aria-label="5-star rating">...</svg>
<svg aria-hidden="true" focusable="false">...</svg> <!-- decorative -->

This guide isn't affiliated with or endorsed by Google.

Sources and references

TAGSPageSpeed InsightsSvg img role accessible textSvg accessibilitySvg title aria-label
Nazmul Nikhil

About the author

Nazmul Nikhil

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.

Need help with this?

Get it fixed with Technical SEO

I find the issues that cost you traffic and fix them, starting with the pages that matter most.

Keep reading

Related articles

All Page Speed & Core Web Vitals posts →

Get the next guide in your inbox

One email when a new SEO or AI search guide goes live.

Ready to grow?

Get a free audit of your website, or book a 30-minute call to talk through your goals.

Nazmul Hasan

Talk to Nazmul directly

Reply within 24h

WhatsApp +880 1682835118
nazmulnikhil@gmail.com