Skip to content
Nazmul Nikhil
Menu

Elements With role="dialog" or role="alertdialog" Do Not Have Accessible Names (PageSpeed Insights)

Cookie banners, popups and modals often fail this check. Here's how to give a dialog a name with aria-labelledby, on any platform.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 1 min read
Elements With role="dialog" or role="alertdialog" Do Not Have Accessible Names (PageSpeed Insights)
Photo: Nathália Rosa on Unsplash

In short

When a dialog opens, screen readers announce its name so users know what appeared. PageSpeed flags elements with role="dialog" or role="alertdialog" that have no name. Point aria-labelledby at the dialog's heading, or add aria-label. Weight 7. It also counts against the Agentic Browsing accessibility-tree check.

This check often fails because of a cookie consent banner or a newsletter popup, not the page itself.

The fix

<div role="dialog" aria-modal="true" aria-labelledby="cookie-title">
<h2>Cookie preferences</h2>
...
</div>

No visible heading? Use aria-label="Cookie preferences".

Where it usually comes from

Source Fix
Cookie consent banner Check the tool's accessibility settings, update it, or add the label via its custom code option
Newsletter or promo popup Add a heading and link it
Theme modals (search, quick view, cart drawer) Edit the template or ask the theme author

WordPress: popup and cookie plugins vary; current versions of major ones label dialogs. Shopify: check cart drawers and app popups. Webflow: add aria-labelledby as a custom attribute on the modal wrapper. Wix: lightboxes; check accessibility settings.

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

Sources and references

TAGSPageSpeed InsightsRole dialog does not have accessible nameAria-dialog-nameCookie banner accessibility
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