Zimt

Remove Cookie Banners from Screenshots Without Changing Consent

· 6 min read · Cookies and Bars

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide shows you how to remove cookie banners from screenshots taken of a webpage, without actually accepting or rejecting any cookies. This is useful for creating clean UI mockups, documentation, or presentations. You'll need a browser with developer tools (Chrome, Firefox, Edge, Safari) and basic familiarity with the browser's inspect panel.

What You'll Need

  • A modern desktop browser (Chrome, Firefox, Edge, or Safari)
  • The webpage where the cookie banner appears
  • Basic knowledge of right-clicking and using the browser's developer tools

Step-by-Step

  1. Open the webpage in your browser. Do not click “Accept” or “Reject” on the cookie banner yet. Just let it load as it normally would.
  2. Right-click on the cookie banner (or on the area where it appears). In the context menu, choose “Inspect” (or “Inspect Element”). This opens the developer tools with the banner's HTML element highlighted.
  3. Locate the outermost element of the banner. In the Elements/Inspector tab, you'll see the highlighted node. Look upward in the HTML tree to find the container that wraps the entire banner (often a div with an ID or class like “cookie-consent”, “cookie-banner”, “gdpr”, etc.). Right-click that element in the HTML tree and select “Copy” → “Copy outerHTML”. Save this somewhere – you'll need it to restore the banner later.
  4. Delete the banner element from the DOM. With the element still highlighted, press the Delete key on your keyboard. The banner should disappear from the page immediately. If it doesn't, right-click the element and choose “Delete Element” from the context menu.
  5. Take your screenshot. Use your preferred screenshot tool (e.g., browser's built-in screenshot, OS screenshot, or a browser extension). Make sure the page looks exactly as you want, without the cookie banner.
  6. Restore the banner (optional but recommended). If you want the page to behave normally after you're done, reload the page (F5 or Cmd+R). The banner will come back, and your cookie consent status remains unchanged (you never clicked anything).

Common Mistakes

  • Deleting the wrong element: If you delete only a child element (like a button inside the banner), the banner may still be visible or look broken. Always delete the outermost container that holds the entire banner.
  • Clicking “Accept” or “Reject”: This changes consent. The method relies on never interacting with the banner's buttons. If you accidentally click, reload the page and start over.
  • Not saving the HTML: If you forget to copy the outerHTML, you might not be able to restore the banner without reloading. Reloading resets the DOM, so it's not a big issue, but saving helps if you need to keep the page state for other reasons.
  • Using a screenshot tool that captures the whole page: Some full-page screenshot tools may render the banner again if it's injected via JavaScript after the initial load. In that case, delete the banner and take the screenshot quickly, or use a tool that captures the current viewport.

Tips

  • Use the “Inspect” shortcut: Press Ctrl+Shift+C (Windows/Linux) or Cmd+Shift+C (Mac) to open the inspector and hover over the banner to highlight it quickly.
  • Hide instead of delete: In the Elements panel, you can right-click the element and select “Hide Element” (in Chrome) or add a style rule like display: none; to hide it. This is reversible and may be easier for beginners.
  • Use a dedicated browser extension: Extensions like “Remove Cookie Banners” or “I don't care about cookies” can hide banners temporarily, but they may change consent or interfere with the page. The manual method is more reliable for screenshots.
  • Test in an incognito window: If you're worried about affecting your browsing data, use a private window. The banner will appear, and you can delete it without affecting your normal profile.
  • Take multiple screenshots: If you need several screenshots of different pages, repeat the process for each page. The DOM manipulation is per-page and resets on reload.

Troubleshooting

  • Banner doesn't disappear after deleting the element: Some banners are re-inserted by JavaScript after a short delay. Try deleting the element again, or use the “Hide Element” option. If it persists, the banner might be inside an iframe – you'll need to switch to the iframe's context in the inspector (look for the iframe in the HTML tree and right-click → “Inspect” within it).
  • Can't find the banner element in the inspector: Right-click directly on the banner text or a button inside it. If that doesn't highlight, use the “Select an element” tool (cursor icon) in the developer tools and click on the banner visually.
  • Page layout shifts after deleting the banner: The banner might be taking up space, and removing it could cause the content to move. If you want the layout to stay the same, you can add a CSS rule to hide the banner but keep its space: in the inspector, add visibility: hidden; to the element's style instead of deleting it.
  • Screenshot still shows the banner: If you're using a full-page screenshot tool, it might wait for the page to settle and re-render the banner. Try taking a viewport screenshot (just the visible part) or use the browser's built-in screenshot (e.g., right-click → “Take Screenshot” in Chrome).
  • Consent seems changed after reload: Reloading the page should reset everything to the initial state. If you see a different banner or no banner, it might be because the site uses localStorage to remember your choice. In that case, clear the site's data (in Chrome: DevTools → Application → Storage → Clear site data) and reload.

Frequently Asked Questions

Will this actually change my cookie consent?

No, because you never click any button on the banner. You only modify the DOM temporarily. Your consent status remains exactly as it was before – which is “no choice made” or whatever the site's default is.

Can I use this method on any website?

Yes, as long as the banner is part of the page's HTML. Some banners are inside iframes, but you can still inspect and remove them by switching to the iframe context in the developer tools.

Is it legal to remove cookie banners for screenshots?

Yes, this is a common practice for developers and designers. You're not circumventing consent; you're just cleaning up the visual for a screenshot. The banner is still there for actual users.

Will the banner come back after I reload?

Yes, reloading the page will restore the original DOM, including the cookie banner. Your changes are temporary and only affect the current page load.

Can I do this on a mobile browser?

It's harder on mobile because developer tools are not as accessible. You can use remote debugging or a desktop browser with mobile emulation to achieve the same result.

What if the site uses a cookie wall that blocks content?

In that case, removing the banner might still leave the content blocked (e.g., a gray overlay). You may need to also remove the overlay element or use a different approach, such as disabling JavaScript temporarily.