UK cookie law is built on two statutes that operate in tandem. PECR regulation 6 prohibits storing or reading information on a visitor's device without consent, unless the storage serves a strictly necessary purpose. The UK GDPR then sets the bar for what consent has to look like: freely given, specific, informed, and delivered through an unambiguous affirmative action, with withdrawal made no harder than the original agreement. For UK visitors, the upshot is an opt-in banner, a reject button given equal prominence to accept, and every analytics or advertising tag held back until the visitor actively agrees.
On WordPress the banner itself is rarely the weak spot. The tracking is: analytics plugins, pixel snippets and form tools each inject their own scripts, and an opt-in banner only works for UK visitors when every one of those scripts waits for the choice. CookieBeam's plugin loads the banner ahead of everything else; the WP Consent API tells cooperating plugins to hold back, and inert markup handles the ones that don't cooperate.
| Requirement | What the law expects |
|---|---|
| Consent before non-essential storage | PECR regulation 6 demands consent before storing or reading data on a device, unless the storage is strictly necessary or qualifies for one of the statutory exceptions |
| What counts as consent | The UK GDPR requires a clear affirmative act that is both specific and informed. Pre-ticked boxes and consent inferred from continued browsing do not meet the standard |
| Rejecting | The ICO expects a reject option for non-essential cookies that is equally visible and easy to reach as the accept option, displayed on the same layer of the banner |
| Withdrawing | Visitors must be able to withdraw consent whenever they wish, and the withdrawal process cannot be harder than the original consent was |
| Statutory exceptions | The Data (Use and Access) Act 2025 introduced exceptions for certain analytics, visual-preference and security cookies, provided you give clear information and offer a simple objection mechanism. No exception covers advertising cookies |
How CookieBeam's UK GDPR preset handles it
CookieBeam provides a regional preset designed for UK visitors. Applying it generates an editable rule that ships with the following starting values.
| Setting | CookieBeam preset |
|---|---|
| Who it matches | Visitors in the United Kingdom |
| Banner mode | Opt-in: analytics and advertising stay off until the visitor accepts |
| Buttons | "Accept all cookies" and "Reject non-essential cookies" on the first layer, with equal weight, plus "Cookie settings" |
| Google Consent Mode defaults | ad_personalization, ad_storage, ad_user_data, analytics_storage and personalization_storage start denied |
| Global Privacy Control | Not acted on unless you turn on privacy signals; when on, it pre-selects deny and an explicit opt-in still wins |
| Stored choice | Expires after 182 days, then the visitor is asked again |
Where WordPress sites leak data
- Tracking plugins. Analytics, pixel and form plugins inject their own scripts. When the WP Consent API plugin is installed, CookieBeam relays the visitor's choice to it, and plugins that read consent through that API (such as WooCommerce and Site Kit) respect the banner. Plugins that don't check the API need their scripts blocked separately.
- Theme and header-script plugins. A pixel dropped into
header.phpor added through an "insert headers" plugin fires before anything else can intervene, unless it's written as inert markup that CookieBeam activates. - Optimisation plugins. Delay-JavaScript features can reorder scripts so that a pixel loads ahead of the banner. The CookieBeam plugin excludes itself from WP Rocket, LiteSpeed Cache, Autoptimize, SiteGround Optimizer and Perfmatters; for any other optimiser, exclude
cdn.cookiebeam.commanually.
Plugins that follow the banner, and plugins that don't
With the WP Consent API plugin active, CookieBeam registers as the site's consent provider and reports the visitor's choice through wp_set_consent(). Before the visitor chooses, it reports the consent type as optin, which is what UK visitors need: plugins that check the API, including WooCommerce and Site Kit, hold their statistics and marketing features until the visitor accepts.
Plugins that don't check the API fire whenever WordPress prints their scripts. For those, let the scanner discover and categorise them, or rewrite the tag as inert markup with type="text/plain" and a data-category. The mapping between WP Consent API categories and CookieBeam's consent state is in the WordPress docs.
Set up CookieBeam on WordPress for UK GDPR and PECR
Publish your banner first
Build the banner in CookieBeam, set up its consent categories, and publish it to production so the loader script has a live configuration to serve. See the quickstart.
Install the CookieBeam plugin
Open Plugins › Add New Plugin › Upload Plugin in WordPress, upload the CookieBeam plugin zip and activate it. The plugin isn't listed in the WordPress.org directory yet, so a search there won't return it.
Paste the banner ID
Copy the banner ID from Deployment › Install in CookieBeam and paste it into Settings › CookieBeam in WordPress, then save. The plugin places the loader first in <head> and prevents caching and optimisation plugins from deferring it. If you previously pasted a CookieBeam script tag into the theme, remove it so the banner doesn't load twice.
Add a "Cookie settings" link
Create a menu or footer link pointing to #cookiebeam-settings (classic themes also get a CookieBeam box under Appearance › Menus) so visitors can reopen their preferences and change their choice at any time.
Apply the UK GDPR preset
On the banner's Regional settings page, add a rule from the UK GDPR framework preset. It matches visitors in the United Kingdom with an opt-in banner: analytics and advertising stay off until the visitor accepts. Add the GDPR (EU/EEA) preset too if you also serve EU visitors. See regional rules.
Put every tag in a category
Assign analytics tags to the analytics category and advertising pixels to marketing. Scripts that appear in your reviewed scan inventory are managed by CookieBeam once you turn on blocking; scripts hard-coded in the page need inert markup (type="text/plain" with a data-category attribute) so CookieBeam can control them. See script blocking. In opt-in mode, those scripts stay inert until the visitor accepts the relevant category.
Save, publish and test
Click Save Settings, then Publish in the banner header. Changes to rules only take effect for visitors after you publish. Full install instructions: WordPress install docs.
Test your WordPress site like a UK visitor
- Open the site in a fresh browser profile from the UK, or with a geo-simulated preview, and confirm the opt-in banner appears with both reject and accept buttons on the first layer.
- Before making any choice, open the Network tab: no analytics or advertising requests should have gone out.
- Click reject, reload the page, and verify those requests still haven't appeared.
- Reopen the cookie preferences, accept analytics only, and check that only analytics tags activate.
- Clear the page cache and any optimisation-plugin cache after publishing, then run the checks again while logged out, because logged-in administrators often see a different set of scripts.
The cookie banner QA checklist walks through additional checks.
Frequently Asked Questions
Does WooCommerce follow the banner for UK shoppers?
Its tracking features do when the WP Consent API plugin is active, because WooCommerce reads consent through that API and CookieBeam writes to it. Extensions that drop their own pixels without checking the API need those pixels gated separately.
Is a plugin required to add a cookie banner on WordPress?
Not strictly, but it's the easiest way. The CookieBeam plugin loads the script first in the head and shields it from optimisation plugins. You can also add the loader to the theme manually; see WordPress cookie consent without a plugin.
Does page caching interfere with the banner?
No. Full-page caching works fine because the banner resolves consent in the browser. The problem is an optimiser that delays or combines the banner script, and the plugin prevents that for the most common optimisation plugins.
Is the UK GDPR or PECR the law that requires a cookie banner?
PECR is the statute that requires consent before storing or reading information on a device. The UK GDPR defines what valid consent looks like. Both statutes are needed to get the banner right.
Can analytics cookies run without consent in the UK now?
In some cases. The Data (Use and Access) Act 2025 introduced an exception for analytics used solely to improve your own service, provided you give clear information and offer a straightforward way to object, and the data doesn't go beyond the provider assisting you. Analytics tools that use the data for their own advertising are unlikely to qualify. Work through the decision with your adviser; the PECR guide covers the conditions in detail.
Related guides and sources
For WordPress: WordPress cookie consent: the complete implementation guide. For the law: PECR and UK cookie law after Brexit, UK GDPR after Brexit, the one-click reject rule. Other platforms: UK GDPR and PECR setup by platform.
Primary sources: PECR regulation 6 (legislation.gov.uk), ICO guidance on PECR.
This page summarises the law as we understand it in October 2026 for website and cookie decisions. It is not legal advice. Statutes, regulations and regulator guidance change, so check the current text with counsel before relying on any threshold or date mentioned here. CookieBeam's regional presets are configurable starting points, not a legal determination for your site.






