# How cookie banners work, and how to hide them

> A cookie banner taken apart layer by layer: why sites show one, how it works, and three ways to remove it from a screenshot, with what each leaves behind.

Anatomy by Serghei Pogor, founder of CurlShot (https://curlshot.com/about/serghei-pogor). Published 22 October 2026. Page for people: https://curlshot.com/blog/how-cookie-banners-work

A cookie banner is a box that a consent script draws over a page, often with a dimming overlay and a scroll lock, because EU and UK law require consent before a site stores or reads non-essential information on a device. There are 3 ways to keep it out of a screenshot: hide it with CSS (the overlay and the lock can stay), block the consent script (consent-gated content stays empty), or answer it by pressing a button or sending the consent cookie (cleanest, but different on every site). CurlShot applies all three with one option, block_cookie_banners=true, as a best effort.

## Key facts

- A cookie banner has up to 3 visible layers (the banner box, a dimming overlay, a scroll lock on the page) and 2 parts behind them (the consent script and the stored choice).
- Article 5(3) of the ePrivacy Directive covers "the storing of information, or the gaining of access to information already stored" on a device, so it applies to localStorage as well as cookies. It never mentions banners.
- Hiding a banner with CSS removes the box only: the overlay can leave the page grey and the scroll lock can cut a full-page screenshot off at one screen.
- Blocking the consent script draws nothing and stores nothing. Under the IAB TCF specification, vendors that get no answer from a consent tool "should assume" no consent.
- Answering the banner (a click, or the site’s consent cookie) is the cleanest method, and the only reliable one for a full-screen wall, but the button and the cookie differ on every site.
- In CurlShot, block_cookie_banners=true blocks known consent tools, hides their containers and presses a button on dialogs it does not recognise. It is off by default and best effort; hide_selectors, click and cookies handle the rest.

## A cookie banner, taken apart

A cookie banner is not one thing. It is up to three things drawn on top of the page, plus two that work behind it.

| Layer | What it is | Drawn on the page |
| --- | --- | --- |
| Banner box | An element with `position: fixed` and a high `z-index`, holding the text and the buttons. | Yes |
| Dimming overlay | A second fixed element the size of the window, with a translucent background. | Yes |
| Scroll lock | `overflow: hidden` on `html` or `body`, usually through a class the script adds. | Yes |
| The page | The content you wanted in the screenshot. | Yes |
| Consent script | The JavaScript that draws the banner and holds other scripts back. | No |
| Stored choice | A cookie or a `localStorage` entry that records what the visitor chose. | No |

What each state of the page looks like in a screenshot:

| State | Page | Overlay | Banner | Scroll lock | Consent script | Stored choice | Verdict |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Build up: Page | Visible | Not yet | Not yet | Not yet | Not yet | None | The page on its own: what you wanted in the screenshot. |
| Build up: + overlay | Dimmed | On | Not yet | Not yet | Running | None | One element the size of the window, with a translucent background, dims everything under it. |
| Build up: + banner | Dimmed | On | On | Not yet | Running | None | The banner box sits above the overlay and stays in place while the page scrolls. |
| Build up: + scroll lock | Dimmed | On | On | On | Running | None | A first-time visitor sees this: page dimmed, banner on top, scrolling switched off until a button is pressed. |
| Remove: Hide it with CSS | Dimmed | Still there | Hidden | Still on | Running | None | The banner is gone, but a rule that names only the box leaves the page dimmed and locked at one screen. |
| Remove: Block the script | Embed empty | Never drawn | Never drawn | Never set | Blocked | None | Nothing is drawn, so nothing needs hiding. Anything that waits for consent, such as an embedded video, stays empty. |
| Remove: Answer it | Visible | Removed by the site | Closed by the site | Released | Running | Stored | The site removes its own overlay and lock. Cleanest result, but the button or cookie is different on every site. |

## Three ways to remove a cookie banner, and what each leaves behind

| Method | How it works | What it leaves behind | Best for | Options that do it |
| --- | --- | --- | --- | --- |
| Hide it with CSS | Add a style rule that sets `display: none` on the banner element, found by its id or class. | The consent script still runs. If the rule names the box only, the dimming overlay and the scroll lock stay, so the page is grey and may be cut off at one screen. No choice is stored. | Bars, corner boxes and inline notices, which have no overlay and no lock. | `hide_selectors`, `styles`, and the built-in rules of `block_cookie_banners` |
| Block the consent script | Stop the request for the consent tool before it leaves the browser, so the banner is never built. | Nothing is drawn and nothing is stored. Content the site holds back until consent (embedded video, maps, ads) stays empty, and a site that waits for the script before it renders can show little or nothing. | Sites that use a well-known consent tool loaded from its own address. | `block_requests`, and the built-in list of `block_cookie_banners` |
| Answer it | Press a button in the banner, or send the cookie the site would have stored after a choice. | The site removes its own banner, overlay and lock, and the choice is stored for that capture. The page then shows whatever that choice shows: after "Reject", consent-gated embeds stay off; after "Accept", ads and trackers load. | Centre modals and full-screen walls, and any capture that must reflect a specific choice. | `click`, `cookies`, and the button fallback of `block_cookie_banners` |

## Why does every site show a cookie banner?

Sites show a cookie banner because, in the European Union and the United Kingdom, storing or reading information on a visitor’s device needs that visitor’s consent unless the storage is strictly necessary, and consent has to be a clear action. The law does not mention banners. A banner is how sites ask. This is a summary of the texts, not legal advice.

**ePrivacy Directive 2002/58/EC, Article 5(3)** (European Union, applied through each member state’s own law) [1]

> the storing of information, or the gaining of access to information already stored, in the terminal equipment of a subscriber or user is only allowed on condition that the subscriber or user concerned has given his or her consent, having been provided with clear and comprehensive information

The rule is about storing or reading anything on a device, not about cookies by name, so `localStorage` and similar storage are covered too. The same paragraph exempts storage that is "strictly necessary" to provide a service the user "explicitly requested".

**GDPR, Regulation (EU) 2016/679, Article 4(11)** (European Union) [2]

> ‘consent’ of the data subject means any freely given, specific, informed and unambiguous indication of the data subject’s wishes by which he or she, by a statement or by a clear affirmative action, signifies agreement to the processing of personal data relating to him or her

This definition is why a banner has buttons. Consent has to be an action, so a notice that only says "by using this site you agree" does not collect it.

**GDPR, Article 7(1) and 7(3)** (European Union) [2]

> the controller shall be able to demonstrate that the data subject has consented [...] It shall be as easy to withdraw as to give consent.

This is why the choice is stored (the site has to be able to show it) and why many sites keep a small "cookie settings" link or button on every page.

**ICO, guidance on storage and access technologies, "How do we manage consent in practice?"** (United Kingdom, under PECR and the UK GDPR) [3]

> Our consent mechanism makes it as easy to refuse consent as it is to accept. [...] Storage and access technologies are only set when valid consent is gathered, or when they meet an exception.

The regulator expects a "reject all" beside "accept all", and nothing optional set before the click. On people who ignore the banner the same page says: "Silence or inactivity doesn’t qualify."

The ePrivacy text refers to Directive 95/46/EC for the meaning of consent. GDPR Article 94(2) says references to that repealed directive "shall be construed as references to this Regulation", so the GDPR definition applies. [2]

## How does a cookie banner work?

A consent system has five parts, and the banner is only the one you can see.

1. **Consent management platform script** (`<script src="cmp.js">`). The consent management platform (CMP) script loads early, before other tags. It looks for a stored choice. If it finds none, it builds the banner.
2. **Banner UI** (`Reject all · Accept all`). The banner is ordinary HTML and CSS added to the page: a fixed box, often an overlay under it and a scroll lock on the page. It is the only part a screenshot shows.
3. **Stored choice** (`consent=analytics:no`). When a button is pressed, the script writes the choice to a first-party cookie or to `localStorage`. On the next visit it reads the choice and draws nothing. Each tool uses its own name and format.
4. **Tag gating** (`analytics · ads · embeds`). Scripts that need consent are held back, for example by a tag manager or by placeholders, and released only when the stored choice allows them. This is the part that matters legally; the banner is just its front.
5. **TCF consent string** (`__tcfapi("addEventListener", ...)`). On sites that use IAB Europe’s Transparency and Consent Framework, the CMP also encodes the choice as a TC String and exposes it to advertising vendors through a JavaScript function named `__tcfapi`. The specification leaves the storage mechanism "up to a CMP", and says that when no CMP answers, vendors "should assume" there is no consent. [4][5]

IAB Europe’s page for the framework says TCF v2.3 was launched in April 2025. [6] The CMP API specification says: "Every consent manager MUST provide the following API function", `__tcfapi`. [5]

## Types of cookie banner

| Type | What it looks like | What it ruins in a screenshot | How to remove it |
| --- | --- | --- | --- |
| Bottom bar | A full-width strip fixed to the bottom (sometimes the top) of the window. No overlay, the page scrolls. | A strip of the first screen. The content under it is covered, the rest is fine. | Hide it with CSS. There is nothing else to clean up. |
| Corner box | A small card fixed in a bottom corner. No overlay, the page scrolls. | One corner of the first screen, often on top of a chat bubble or a call to action. | Hide it with CSS. |
| Centre modal with overlay | A dialog in the middle, a dimming overlay over the whole page, and usually a scroll lock. | The whole screenshot: the dialog covers the middle and everything else is grey. | Answer it, or block the script. Hiding works only if the rule also covers the overlay and the lock. |
| Full-screen wall | The consent screen fills the window. Some sites do not load the content at all until a choice is made. | Everything. The screenshot is of the consent screen, not the page. | Answer it. Hiding the wall can leave an empty page behind it. |
| In-page inline notice | A notice that is part of the page flow, usually above the header. It pushes the content down. | A band at the top. Nothing is covered, but everything sits lower than it should. | Hide it with CSS. A hidden element takes no space, so the page moves back up. |

## How do cookie banner blocking lists work?

A cookie banner blocking list is a text file of rules, kept up by volunteers, that an ad blocker applies to every page. There are two kinds of rule: an element hiding rule, which hides anything matching a CSS selector, and a blocking rule, which stops a network request. [10]

| Kind | Rule | How to read it | Effect |
| --- | --- | --- | --- |
| Element hiding rule | `###cookie-banner` | `##`: hide elements that match; `#cookie-banner`: a CSS selector: the element with the id cookie-banner | On every site, an element with that id is hidden. The script that made it still runs. [8][10] |
| Site-specific hiding rule | `example.com##.newsletter-bar` | `example.com`: apply on this site only; `##`: hide elements that match; `.newsletter-bar`: a CSS selector: elements with this class | The same, limited to one site, so a common class name does not hide real content elsewhere. [10] |
| Blocking rule | `-cookie-consent.js` | `-cookie-consent.js`: a piece of a request address | Any request whose address contains that text is stopped at the network level, so the script never loads. [9][10] |

| List | What it is | Who maintains it | Status on 2026-10-11 |
| --- | --- | --- | --- |
| EasyList Cookie List | A filter list that, in its own words, "blocks cookies banners, GDPR overlay windows and other privacy-related notices". It is also included in Fanboy’s Annoyance List. | The EasyList authors. The project names four: Fanboy, MonztA, Khrin and Yuki2718. | Active. Its files in the EasyList repository were last changed on 2026-10-10. The general hiding file alone was 15,325 lines long and the general blocking file 986 lines. [7][8][9] |
| I don’t care about cookies | A browser extension. Its site says: "In most cases, it just blocks or hides cookie related pop-ups", and that when a site needs it, the extension "will automatically accept the cookie policy for you". | The extension’s site does not name an owner. The fork below states that the extension was acquired by Avast. | Listed for Firefox, Chrome, Edge and Opera on its site. [11][12] |
| I still don’t care about cookies | A community fork of the extension above, described by its README as a "debloated fork". | OhMyGuus, named in the README as the current maintainer, with contributors on GitHub. | The repository’s latest commit was dated 2026-06-21. [12] |

List-based blocking is best effort. A list knows only the banners someone has reported. A site that renames a class, builds its own banner or loads its consent script from its own address is missed until a rule is added, and a generic rule can hide the box while leaving the overlay and the scroll lock.

## How to screenshot a page without the cookie banner in CurlShot

CurlShot does not use the community lists. It has its own short list of well-known consent tools, and `block_cookie_banners` applies all three methods with it. In the online tool the same thing is the "Hide ads and cookie pop-ups" switch. It is off by default in the API, so a plain request shows the page as a first-time visitor sees it.

```bash
curl -G "https://curlshot.com/api/v1/screenshot" \
  --data-urlencode "access_key=YOUR_ACCESS_KEY" \
  --data-urlencode "url=https://example.com" \
  --data-urlencode "block_cookie_banners=true" \
  --data-urlencode "hide_selectors=#site-cookie-note" \
  --data-urlencode "full_page=true" \
  --data-urlencode "delay=2" \
  --output clean.png
```

| Option | Method | What it does |
| --- | --- | --- |
| `block_cookie_banners=true` | All three, in order | Blocks requests to well-known consent tools, hides the banner containers those tools use and undoes their scroll-lock classes, then looks for a consent dialog it did not recognise and presses one of its buttons, trying "reject" wording before "accept". |
| `hide_selectors` | Hide it with CSS | Sets `display: none` on every element matching your CSS selectors. Up to 50 selectors. A selector that matches nothing is not an error. |
| `styles` | Hide it with CSS | Adds your own CSS to the page. Use it to undo what hiding leaves behind, for example `html, body { overflow: auto !important }` for a scroll lock. |
| `block_requests` | Block the consent script | Blocks requests whose address matches your patterns, for a consent script the built-in list does not know. Up to 50 patterns, with `*` as a wildcard. |
| `click` | Answer it | Clicks the first element matching one CSS selector before the capture, such as the banner’s reject button. If nothing clickable matches, the request fails with `selector_not_found`. |
| `cookies` | Answer it | Sends cookies with the page load, in `name=value` form. Send the consent cookie the site stores after a choice and the banner is never shown. The name and value are specific to each site. |
| `delay` | Timing | Waits a number of seconds before the capture. With `block_cookie_banners`, a banner that appeared during the wait gets a second pass. |

It is best effort. A small or regional consent tool may not be on the list, and a home-made banner may have no button it recognises. When the built-in pass presses a button, the choice made is whichever button it found, so a capture that must reflect a specific choice should use `click` or `cookies`. For a home-made banner, hide it with `hide_selectors` or answer it with `click`.

More: [screenshot without cookie banners](https://curlshot.com/tools/screenshot-without-cookie-banners), [screenshot without ads](https://curlshot.com/tools/screenshot-without-ads), [blocking ads, cookie banners, trackers and chats](https://curlshot.com/docs/blocking), [custom CSS, JavaScript and clicks](https://curlshot.com/docs/customize).

## Hiding a banner is not consent

Hiding a cookie banner in a screenshot is about a clean image. It is not consent, and it must not be used to track people. A capture service that visits a page is a first-time, signed-out visitor: it has made no choice, and removing the banner does not make one on anybody’s behalf. If a screenshot is meant as a record of what a visitor saw, leave the banner in.

## Checklist for a clean capture

1. **Capture once with nothing switched on.** A capture service arrives as a first-time, signed-out visitor, so you see the banner exactly as the site shows it. Note its type from the field key.
2. **Switch on general banner blocking.** It clears the common consent tools on most sites with one option and no site-specific work.
3. **Check the result for the three leftovers.** A grey page (overlay still there), a full-page capture that can stop after one screen (scroll lock), and empty boxes where embeds should be (consent-gated content).
4. **For a home-made banner, find its selector.** Open the page in a browser, right-click the banner and choose Inspect. Take the `id` or `class` of the outermost banner element, and of the overlay if there is one.
5. **Hide a bar, a corner box or an inline notice.** Pass the selectors to be hidden. If the page stays locked, add a style rule that restores `overflow`.
6. **Answer a modal or a wall.** Click the reject or accept button by selector, or send the site’s consent cookie. Choose the button that matches what the screenshot is meant to show.
7. **Give late banners time.** Some banners appear a second or two after load. Add a short delay so the banner exists when it is removed.
8. **Keep it honest.** If the screenshot is a record of what a visitor saw, leave the banner in: it was part of the page.

## Glossary

- **Consent:** In the GDPR, a "freely given, specific, informed and unambiguous indication" of a person’s wishes, given "by a statement or by a clear affirmative action". Hiding a banner is not consent. [2]
- **Consent management platform (CMP):** The software that shows the banner, stores the choice and tells other scripts what was chosen. IAB Europe’s specification uses CMP for the provider of that software. [5]
- **TCF string (TC String):** The encoded record of a choice in IAB Europe’s Transparency and Consent Framework. The specification says its purpose is to "encapsulate and encode all the information disclosed to a user and the expression of their preferences". It is made of segments joined by a dot. [4]
- **First-party cookie:** A cookie whose domain and scheme match the page in the address bar. A consent choice is normally stored in one. [13]
- **Third-party cookie:** A cookie that belongs to a different site from the page being viewed, typically set by an embedded resource such as an ad or a widget. [13]
- **Overlay:** A fixed element the size of the window, drawn between the page and the banner. Usually translucent, so the page looks dimmed, and it swallows clicks.
- **Scroll lock:** A style, usually `overflow: hidden` on `html` or `body`, that stops the page behind a dialog from scrolling. It is removed when the dialog is answered.

## Questions

### Why does every website show a cookie banner?

Because in the EU and the UK a site needs the visitor’s consent before it stores or reads information on their device, unless that storage is strictly necessary for the service. The rule is Article 5(3) of the ePrivacy Directive, and the GDPR defines consent as a clear affirmative action. A banner with buttons is the usual way to ask. This is not legal advice.

### How do I take a screenshot without the cookie banner?

Use one of three methods: hide the banner element with CSS, block the consent script so the banner is never built, or answer the banner by clicking a button or sending the consent cookie. In CurlShot, add block_cookie_banners=true to the request, or keep "Hide ads and cookie pop-ups" switched on in the online tool.

### Why is my screenshot still grey after I hid the cookie banner?

The banner box and the dimming overlay are separate elements. A rule that hides only the box leaves the overlay in place, so the page stays dimmed. Hide the overlay element too, or answer the banner so that the site removes both itself.

### Why does my full-page screenshot stop after one screen on a site with a cookie banner?

Many consent dialogs lock scrolling by setting overflow: hidden on the html or body element. Hiding the banner does not undo that. Restore it with a style rule such as html, body { overflow: auto !important }, or answer the banner so the site releases the lock.

### Is hiding a cookie banner the same as accepting cookies?

No. Hiding a banner changes what is drawn and stores no choice, so it is neither consent nor refusal. Pressing "Accept" or sending an accepting consent cookie is different: the site then behaves as it does for a visitor who accepted, and loads what that choice allows.

### Does cookie banner blocking work on every site?

No. Blocking by list is best effort, in ad blockers and in screenshot services alike. A list covers the consent tools and class names someone has added to it. A home-made banner or a renamed element is missed until you hide it by its own selector or click its button.

### What is the IAB TCF consent string?

It is the TC String of IAB Europe’s Transparency and Consent Framework: an encoded record of what a visitor was told and chose, made of segments joined by a dot. A consent tool that follows the framework exposes it to advertising vendors through a JavaScript function named __tcfapi.

## Sources

1. EUR-Lex, "Directive 2002/58/EC (Directive on privacy and electronic communications), consolidated text of 19 December 2009, Article 5(3)": https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:02002L0058-20091219 (checked 11 October 2026)
2. EUR-Lex, "Regulation (EU) 2016/679 (General Data Protection Regulation), Articles 4(11), 7 and 94(2)": https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679 (checked 11 October 2026)
3. Information Commissioner’s Office (UK), "Guidance on the use of storage and access technologies: How do we manage consent in practice?": https://ico.org.uk/for-organisations/direct-marketing-and-privacy-and-electronic-communications/guidance-on-the-use-of-storage-and-access-technologies/how-do-we-manage-consent-in-practice/ (checked 11 October 2026)
4. IAB Tech Lab and IAB Europe, on GitHub, "Transparency and Consent String with Global Vendor and CMP List Formats (TCF v2)": https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20Consent%20string%20and%20vendor%20list%20formats%20v2.md (checked 11 October 2026)
5. IAB Tech Lab and IAB Europe, on GitHub, "Consent Management Platform API v2 (TCF)": https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md (checked 11 October 2026)
6. IAB Europe, "Transparency and Consent Framework": https://iabeurope.eu/transparency-consent-framework/ (checked 11 October 2026)
7. EasyList, "EasyList: overview of the filter lists and their authors": https://easylist.to/ (checked 11 October 2026)
8. EasyList, on GitHub, "EasyList Cookie List: general element hiding rules (easylist_cookie_general_hide.txt)": https://raw.githubusercontent.com/easylist/easylist/master/easylist_cookie/easylist_cookie_general_hide.txt (checked 11 October 2026)
9. EasyList, on GitHub, "EasyList Cookie List: general blocking rules (easylist_cookie_general_block.txt)": https://raw.githubusercontent.com/easylist/easylist/master/easylist_cookie/easylist_cookie_general_block.txt (checked 11 October 2026)
10. Adblock Plus Help Center, "How to write filters": https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters (checked 11 October 2026)
11. i-dont-care-about-cookies.eu, "I don’t care about cookies": https://www.i-dont-care-about-cookies.eu/ (checked 11 October 2026)
12. OhMyGuus, on GitHub, "I still don’t care about cookies: README": https://github.com/OhMyGuus/I-Still-Dont-Care-About-Cookies (checked 11 October 2026)
13. MDN Web Docs, "Third-party cookies": https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Third-party_cookies (checked 11 October 2026)

## Go deeper

- [Screenshot without cookie banners](https://curlshot.com/tools/screenshot-without-cookie-banners)
- [Screenshot without ads](https://curlshot.com/tools/screenshot-without-ads)
- [Blocking ads, cookie banners, trackers and chats](https://curlshot.com/docs/blocking)
- [Custom CSS, JavaScript and clicks](https://curlshot.com/docs/customize)

## Read next

- [Why website screenshots look wrong, and the fixes](https://curlshot.com/blog/why-website-screenshots-look-wrong.md): A field guide to 11 ways a website screenshot goes wrong, from blank lazy images to cookie banners and cut-off pages, with the cause and the fix for each.
- [Capture a web page as evidence that holds up](https://curlshot.com/blog/web-page-as-evidence.md): A checklist for saving a web page as a credible record: what to capture, how to fix the time with a hash and timestamp, and what makes a screenshot weak.
- [How to screenshot a page behind a login, safely](https://curlshot.com/blog/screenshot-pages-behind-login.md): Four ways to screenshot a page that needs a login: session cookie, bearer token, Basic auth or a signed link. What each one risks, and the safest pattern.
