/ โ† GDPR Fixes / Cookie Banner Dark Patterns
In this guide
  1. What makes a cookie banner a dark pattern
  2. The dark patterns regulators target
  3. Examples of cookie banners: non-compliant and compliant
  4. How to test your own banner
  5. Redesigning the banner: the key code
  6. Platform notes
  7. The fix, step by step
  8. Edge cases worth knowing
  9. Keeping it fixed
  10. Questions and answers

What makes a cookie banner a dark pattern

Regulation 6 of PECR says you may only store or read non-essential cookies on a device if the user has given consent, and the standard for that consent comes from UK GDPR. It must be freely given, specific, informed and unambiguous, and given by a clear positive action. It must also be as easy to withdraw as it was to give.

A dark pattern is any design choice that pushes people towards the answer the site wants rather than letting them choose. On a cookie banner it usually works through one of three levers:

The test regulators apply is simple: would a typical visitor find it as easy to say no as to say yes? If the honest answer is no, the consent is unlikely to be valid. That matters because the cookies you set afterwards, such as analytics, advertising pixels and session replay, then have no lawful basis at all.

๐Ÿ’ก Strictly necessary cookies, such as a shopping basket, a login session or the cookie that stores the consent choice itself, do not need consent. Everything else does, unless a specific legal exemption applies.

The dark patterns regulators target

The European Data Protection Board's cookie banner taskforce published a list of practices its members agreed were problems, and the ICO has written to many UK site owners about the same issues. These are the ones that come up again and again.

Dark patternWhat it looks likeWhy it fails
No reject on the first layerAccept all and Manage settings, with Reject only inside settingsRefusing takes more effort than accepting
Pre-ticked boxesAnalytics and marketing switches already on in settingsSilence or inactivity is not consent
Unequal buttonsSolid Accept button, outline or text-only RejectNudges people towards yes
Link styled rejectContinue without accepting as small text in a cornerEasily missed, not clearly an option
Consent by scrollingBy continuing to browse you agreeNo clear positive action
Cookies set before choiceAnalytics fires on page loadConsent must come first
Legitimate interest togglesSeparate switches for legitimate interest, on by defaultConsent is the only basis for non-essential cookies under PECR
Mislabelled essential cookiesAdvertising cookies listed as necessaryAvoids asking for consent at all
No way to change your mindBanner never reappears and no settings linkWithdrawing must be as easy as giving

Confirmshaming, where the decline button carries guilt-tripping wording, and repeated nagging, where the banner returns on every page after a refusal, are also treated as pressure that undermines a free choice.

Examples of cookie banners: non-compliant and compliant

Example 1: non-compliant

We use cookies to improve your experience.
[ Accept all ]                      Manage preferences

Accept is a large filled button and the only other route is a small link into a settings panel, where every category is already switched on. Refusing needs at least three actions. This is the most common pattern regulators challenge.

Example 2: non-compliant

By continuing to use Example Bakery you agree to our use of cookies.  [ OK ]

There is no choice at all, and the analytics tag fires before the visitor does anything. An OK button that only closes the notice is not consent.

Example 3: borderline

[ Accept all ]   [ Reject all ]   Customise
(Reject all shown as pale grey text on a white button)

The options are present, but the visual weight is so uneven that one barely reads as a button. Fixing the styling is usually enough to bring it into line.

Example 4: compliant

Example Bakery uses cookies
We use essential cookies to run the shop. With your permission we would also
like to use analytics cookies to see which pages are used, and marketing
cookies to measure our adverts. You can change your choice at any time
from the Cookie settings link at the foot of every page.

[ Accept all ]   [ Reject all ]   [ Choose cookies ]

Three buttons of the same size and style, a plain explanation of each purpose, every optional category off by default in the settings panel, and a persistent link to change the choice. Nothing non-essential loads until the visitor clicks Accept or saves choices.

โš ๏ธ A banner can look perfect and still fail if your tags load before the click. Always check what the page does, not only how it looks.

How to test your own banner

Open your site in a private window so no earlier choice is stored, and open DevTools before the page loads.

  1. In the Network panel, filter for known tracking hosts such as google-analytics, googletagmanager, facebook or clarity. Any request before you click is a problem, unless it is a consent-mode ping that sets no cookies.
  2. In Application, then Cookies, note every cookie present before you choose. Only strictly necessary ones should be there.
  3. Click Reject all, reload and check again. No analytics or advertising cookies should appear, now or after browsing three or four pages.
  4. Count the clicks needed to accept and to reject. They should be the same.
  5. Use only the keyboard to reach each button. All options should be reachable with Tab and visible when focused.

A quick console check after rejecting:

document.cookie.split('; ').map(c => c.split('=')[0]).sort()

Names starting with _ga, _gid, _fbp or _clck after a refusal mean tags are ignoring the choice. A GDPR scan does the same check automatically across several pages.

Redesigning the banner: the key code

Give all three choices the same element, the same styles and the same size. Equal treatment in the markup makes it hard for a later restyle to tip the balance:

<div id="consent" role="dialog" aria-labelledby="consent-title" aria-live="polite">
  <h2 id="consent-title">Example Bakery uses cookies</h2>
  <p>Essential cookies run the shop. With your permission we would also use
     analytics and marketing cookies. See our cookie policy.</p>
  <button type="button" data-consent="all">Accept all</button>
  <button type="button" data-consent="none">Reject all</button>
  <button type="button" data-consent="choose">Choose cookies</button>
</div>

Hold back optional scripts until consent by giving them a non-executable type, then switch them on only after a yes:

<script type="text/plain" data-category="analytics" src="/js/analytics.js"></script>

<script>
function enable(category) {
  document.querySelectorAll('script[data-category="' + category + '"]').forEach(old => {
    const s = document.createElement('script');
    if (old.src) s.src = old.src; else s.textContent = old.textContent;
    old.replaceWith(s);
  });
}
</script>

If you use Google tags, set Consent Mode defaults to denied before the tag loads, then update them on the visitor's choice:

gtag('consent', 'default', {
  ad_storage: 'denied', analytics_storage: 'denied',
  ad_user_data: 'denied', ad_personalization: 'denied'
});

Settings panel switches for analytics and marketing must start off. Add a Cookie settings link in the footer that reopens the panel, so changing your mind takes one click from any page. The cookie consent guide covers the full set-up, and tracking without consent explains how to find tags that ignore the choice.

Platform notes

Make the banner usable for everyone: buttons need visible focus and enough contrast. The colour contrast guide and keyboard navigation guide cover both.

The fix, step by step

Step 1

Test the banner in a private window

Open your site in a private window with DevTools open and record which cookies and tracking requests appear before you touch the banner. Then click Reject all and browse a few pages, checking the Application and Network panels again. Write down every non-essential cookie and request you find. This list is your baseline and tells you whether the problem is the design, the script blocking, or both.

Step 2

Put Reject all on the first layer

Add a Reject all button beside Accept all on the first screen of the banner, so refusing takes exactly one click. In a consent platform this is usually a setting for first-layer reject or equal prominence. Keep a third button for choosing categories. Reload the page in a private window and confirm all three choices are visible without scrolling, on both a phone and a desktop screen.

Step 3

Give the buttons equal weight

Style Accept and Reject with the same element, size, shape, font weight and level of contrast, using one shared CSS rule for every banner button. Do not make one a filled button and the other a text link. Remove guilt-tripping or alarming wording from any choice. Check the result on a small screen, where uneven layouts often push the Reject button below the fold or shrink it.

Step 4

Untick every optional category

Open the settings layer and make sure analytics, marketing, personalisation and any other optional categories start switched off. Remove any separate legitimate interest toggles for cookies, because PECR requires consent for non-essential cookies. Move any cookie wrongly listed as strictly necessary into its proper category. Save, clear site data, reload and confirm every optional switch now starts in the off position. Note the date of the change in your records.

Step 5

Block tags until consent

Make sure no optional script runs until the visitor accepts its category. Change hard-coded tags to type="text/plain" with a data-category attribute, set Google Consent Mode defaults to denied, and add consent requirements to tags in Tag Manager. Then repeat the private window test: before any click, and after Reject all, there should be no analytics or advertising cookies and no tracking requests. Check the Tag Manager preview mode as well.

Step 6

Add an easy way to change the choice

Add a Cookie settings link in the site footer that reopens the banner or its settings panel on every page. Make sure withdrawing consent removes the related cookies where possible and stops the tags from loading on the next page view. Test it by accepting all, using the footer link to reject, then reloading and checking that the analytics cookies are no longer being set.

Step 7

Check keyboard and screen reader use

Reach every banner button with the Tab key, check focus is clearly visible, and confirm Enter or Space activates each one. Give the banner a heading and a dialog role so screen readers announce it. Make sure the banner does not trap focus with no way out. A banner only some visitors can operate cannot collect valid consent from the others. Repeat the check with VoiceOver or NVDA.

Step 8

Update the cookie policy and records

Rewrite your cookie policy so its categories, cookie names and lifetimes match exactly what the banner controls. Make sure your consent platform or your own code records when consent was given, what was chosen and which banner version was shown. Keep those records for as long as you rely on the consent. Finally run a GDPR scan across several pages to confirm the banner behaves the same way on every template, including checkout and blog pages.

Edge cases worth knowing

Keeping it fixed

  1. Repeat the private window test after every new plugin, app, tag or theme update, because new tags rarely respect the banner by default.
  2. Keep a written list of each cookie, its purpose, its category and its lifetime, and check it against what the browser actually stores every quarter.
  3. Lock the banner styles into the template so a redesign cannot quietly shrink the Reject button.
  4. Record when and how consent was given, with the banner version, so you can show what visitors saw.

Your cookie policy and privacy notice should match what the banner says. The privacy policy guide shows what to include, and the GDPR compliance checklist puts cookies in the wider picture.

Questions and answers

1. What is a dark pattern cookie banner?

A dark pattern cookie banner is one designed to steer people into accepting cookies rather than letting them make a free choice. Typical examples are a bright Accept button next to a faint Reject link, a reject option that only exists inside a settings screen, categories that are already ticked, and wording that makes refusing sound foolish. Because UK GDPR requires consent to be freely given and unambiguous, consent collected through these designs is generally not valid, so the cookies set afterwards have no lawful basis.

2. Do I need a Reject all button on my cookie banner?

In practice, yes, if you ask for consent to non-essential cookies. The ICO expects refusing to be as easy as accepting, and European regulators have treated a missing first-layer reject option as a clear problem. If Accept all is a single click, the visitor should be able to refuse with a single click on the same screen. A Manage settings link that leads to a page of switches is not equivalent, because it asks for more effort to say no than to say yes.

3. Are pre-ticked boxes allowed on a cookie banner?

No, pre-ticked boxes do not give valid consent. Consent has to be a clear positive action by the visitor, and leaving a box ticked that you ticked for them is inaction rather than a choice. The Court of Justice of the European Union confirmed this for cookies in 2019, and UK GDPR applies the same standard. Every optional category, such as analytics or marketing, must start switched off, and only switch on when the visitor turns it on or clicks Accept all.

4. Can Accept and Reject be different colours?

They can differ slightly, but they should carry the same visual weight. Regulators look at whether one option is obviously easier to notice and press than the other. Two buttons of the same size, shape and contrast, perhaps in different brand shades, are generally fine. A solid high-contrast Accept button beside a pale outline or plain text Reject is the kind of nudging that has been criticised. If in doubt, style both buttons identically and let the labels do the work.

5. Is a cookie wall legal in the UK?

A cookie wall that blocks all access unless visitors accept is risky and usually not compliant for an ordinary site. Consent is not freely given if refusing means losing the service. The ICO has said that consent or pay models, where visitors can pay or use a reduced service instead, may be acceptable in some circumstances, but they need a fair and genuine alternative and a documented assessment. For most small businesses, a normal banner with equal Accept and Reject options is the safer choice.

6. Does closing the banner or scrolling count as consent?

No. Scrolling, continuing to browse, or closing the banner with a cross are not clear positive actions, so they cannot be treated as consent to non-essential cookies. If a visitor closes the banner without choosing, treat it as no consent for now: keep optional tags off and either show the banner again on the next page or leave the footer link available. Only a deliberate click on Accept, or saving a settings screen with categories switched on, counts.

7. What happens if my cookie banner is non-compliant?

The ICO can investigate, issue reprimands or enforcement notices, and fine organisations that set cookies without valid consent. The Data (Use and Access) Act 2025 brings the maximum penalties for PECR breaches into line with UK GDPR levels. In practice, the ICO usually starts by writing to site owners and asking them to fix their banners, and it has publicly named the issues it is checking. Complaints from visitors can also trigger a review, so fixing it promptly is sensible.

Check what your cookie banner really does

The GDPR scan loads your pages as a new visitor, records which cookies and tracking requests fire before and after consent, and flags missing reject options and pre-ticked categories.

Open GDPR Fixes โ†’
๐Ÿ’ฌ Got a problem?
Related Guides: All GDPR Fixes  ·  Cookie consent  ·  Cookie banner not showing  ·  ePrivacy and tracking without consent  ·  GDPR compliance checklist  ·  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.