Skip to main content

Your Cookie Banner Is Probably a WCAG Violation

Syrcha8 min read

Cookie banners are the most-audited element on the modern web and the least-audited at the same time.

Privacy teams review the wording, the purposes and the button labels. Accessibility teams audit the site, but the consent banner is usually injected at runtime by a third-party script, so it's frequently not in the page when the audit runs, and not in scope when the vendor is reviewed.

What you end up with is a component that appears on every page, blocks all other content, is the first thing every user interacts with, and has often never been tested with a keyboard.

Worth fixing on its own terms. There's also a second consequence that privacy teams tend to miss entirely.

The part that makes this a compliance problem, not just a UX one

Consent is only valid under the GDPR if it's freely given: a genuine choice between accepting and refusing.

Now picture a keyboard-only user, or someone on a screen reader, facing a banner where the reject button can't be reached or is never announced. For that user, accepting is possible and refusing is not.

This isn't "refusal is harder than acceptance", the thing regulators have already fined companies hundreds of millions of euro over (see our post on the equal-prominence rule). It's refusal being impossible. Any consent collected from that user isn't freely given, and therefore isn't consent at all.

So an inaccessible banner produces two exposures at once. A WCAG failure under accessibility law, and an invalid legal basis for every tracking cookie you set for those users.

The failure modes, mapped to criteria

Patterns worth checking, with the WCAG 2.2 success criteria they breach.

Focus is not moved into the banner. The banner appears visually, but keyboard focus stays behind it in the page. A keyboard user tabs through the entire header before reaching a modal that's blocking their view. Related to 2.4.3 Focus Order.

Focus is not trapped inside a modal banner. If the banner blocks interaction with the page, focus has to stay within it. Otherwise users tab into content they can't see or use. Also 2.4.3.

The reject control is not reachable by keyboard. Usually a div with a click handler where a real button should be. No keyboard user can activate it. This is 2.1.1 Keyboard, and the point at which refusal becomes impossible.

No visible focus indicator. Sighted keyboard users can't tell which control they're on. 2.4.7 Focus Visible, plus 2.4.11 Focus Not Obscured where a sticky element covers the focused control.

Insufficient text contrast on the reject option. The classic dark pattern, a bold accept button beside a pale grey "reject", is simultaneously a consent problem and a 1.4.3 Contrast (Minimum) failure. Body text needs 4.5:1.

Insufficient contrast on control boundaries. A button whose border or background doesn't reach 3:1 against its surroundings fails 1.4.11 Non-text Contrast.

Controls with no accessible name. An icon-only close button, or a control whose label exists only as a background image, gets announced as "button" with no indication of what it does. 4.1.2 Name, Role, Value.

The banner is not announced. A modal that appears without appropriate role and labelling may never reach a screen-reader user at all. They're simply unaware a choice is being offered.

Escape does not dismiss, and nothing else does either. Some banners can't be closed without making a choice, and offer no keyboard route to any choice. Dead end.

Text does not survive zoom or reflow. At 200% zoom, or 320px width, banner text is frequently clipped or the buttons move off screen. 1.4.4 Resize Text and 1.4.10 Reflow.

Ten minutes of testing

You don't need tooling to find most of this.

Keyboard only. Load the page in a private window. Put the mouse away. Press Tab. Does focus move into the banner? Can you reach the reject control? Can you activate it with Enter or Space? Can you see where focus is at every step?

Screen reader. Turn on VoiceOver or NVDA and reload. Is the banner announced? Are the buttons announced with meaningful names?

Zoom. Set browser zoom to 200%. Anything clipped? Both buttons still visible?

Narrow viewport. Resize to 320px wide. Do the controls still fit and stay operable?

Contrast. Sample the reject button's text and background with any contrast checker. 4.5:1 for text, 3:1 for the control boundary.

If reject fails the keyboard test, treat it as urgent. That's the one that converts an accessibility bug into a consent-validity problem.

Most sites don't build their own banner, which creates a specific blind spot.

The vendor's default template may be perfectly reasonable while your customisation isn't. Teams routinely restyle the reject button into low-contrast secondary text for conversion reasons, which breaks contrast requirements without touching the vendor's markup.

The banner is injected after page load, so automated accessibility scans that snapshot the initial DOM can miss it entirely.

And because it's "the cookie tool", it lands in a procurement or legal review instead of an engineering one, so nobody runs a keyboard test.

Being a customer of a consent platform doesn't transfer the obligation. It's your page.

Where accessibility law bites

In Europe, the European Accessibility Act extends accessibility requirements to a broad range of consumer-facing digital services, with WCAG as the practical reference standard. In the US, ADA Title III litigation over inaccessible websites continues at volume, and WCAG conformance is the usual benchmark.

Neither regime exempts third-party components. A banner injected by a vendor is part of your site.

The takeaway

Run the keyboard test on your own banner today. It takes about a minute, and there's a decent chance you'll find the reject button is a styled div, or that focus never enters the dialog at all.

If refusal is unreachable for some users, you have both an accessibility failure and an invalid consent mechanism for those users, and remediating the accessibility problem fixes the consent problem at the same time.

While you're in there, confirm nothing is firing before consent either, and that the banner satisfies the wider GDPR consent requirements.


This article is general information, not legal advice.

Sources: W3C: Web Content Accessibility Guidelines 2.2 · EDPB: Report of the cookie banner taskforce