Journal · Compliance

How to add a cookie consent banner to your WordPress site (UK law)

How to add a cookie consent banner to WordPress under UK rules, including the 2026 changes: what needs consent and how to set it up. Not legal advice.

By Alleo Gordon, founder of WonderlandSites

Please note: this is general information to help you understand the topic. It is not legal advice. For advice on your own situation, speak to a qualified solicitor or data protection adviser, and read the ICO’s guidance on cookies and similar technologies.

Picture a tutor who embedded a YouTube video on their homepage to introduce themselves. It’s a lovely touch. What they don’t know is that the video can start setting cookies the moment someone lands on the page, before anyone has pressed play or agreed to anything.

Most small business owners never chose to “use cookies”. Cookies arrived with a video, a map, a font, an analytics tool or a booking widget. That’s why a cookie banner isn’t really about the banner. It’s about knowing what your site actually does.

Here’s how UK cookie rules work after the 2026 changes, what needs consent and what doesn’t, and how to set up a cookie consent banner on WordPress, step by step.

Key takeaways

  • In the UK, cookies are covered by PECR, alongside UK GDPR.
  • Strictly necessary cookies never need consent. Since February 2026, some low-risk cookies for statistics or remembering display preferences don’t either, but you must explain them and let people object easily.
  • Advertising and tracking cookies still need consent before they’re set.
  • If you ask for consent, “Reject all” must be as easy as “Accept all”. No pre-ticked boxes.
  • A banner only works if it actually blocks cookies until people choose.

What counts as a “cookie”?

A cookie is a small file a website stores on a visitor’s device. The UK rules cover more than cookies, though. They also cover similar technologies such as tracking pixels, local storage and device fingerprinting. The ICO now calls these “storage and access technologies”. For simplicity, I’ll say “cookies”.

They’re set by:

  • Your own site: for example, remembering someone’s cookie choice, or keeping them logged in.
  • Other companies, through your site: analytics tools, embedded videos and maps, social media buttons, advertising pixels and some booking or chat tools.

What changed in 2026

The Data (Use and Access) Act 2025 changed the cookie rules in PECR, and those changes came into force on 5 February 2026. The ICO finalised its updated guidance on 29 April 2026.

There are now five situations where you don’t need consent. The three that matter most for a small business website are:

  1. Strictly necessary: essential to give the visitor what they asked for, such as remembering their cookie choice or what’s in their basket.
  2. Statistical purposes: collecting information only to produce statistics about how your website is used, so you can improve it. For example, how many people visit each page and how long they stay.
  3. Appearance: remembering how someone wants the site to look or work, such as their language choice or adapting the layout to their screen.

For the statistical and appearance exceptions, there are two conditions. You must give clear information about what you’re doing, and a simple, free way to object. If you don’t, the exception doesn’t apply and you need consent.

There are limits. The statistics exception isn’t for tracking or profiling individual visitors, and it never covers advertising. If you use a third-party analytics tool, the ICO says it must only use the information to help you improve your website, not for its own purposes. Whether your particular analytics set-up qualifies is worth checking carefully against the ICO’s guidance.

What still needs consent

  • Advertising and remarketing cookies and pixels (for example, Facebook or Google ad tracking).
  • Analytics that track or profile individual people, or that feed advertising.
  • Social media plugins that track visitors who aren’t logged in to that network.
  • Anything that doesn’t fit one of the exceptions.

And consent has to be real consent:

  • A clear, positive action. Ticking a box or pressing “Accept”. Scrolling, carrying on browsing or closing the banner doesn’t count.
  • No pre-ticked boxes for cookies that need consent.
  • Refusing must be as easy as accepting. The ICO’s checklist says your consent mechanism should make it as easy to refuse consent as to accept, and its examples show “Accept all” and “Reject all” buttons with equal prominence.
  • Choices by purpose, so people can say yes to some and no to others.
  • People can change their mind later, just as easily.

How to add a cookie consent banner to WordPress, step by step

Step 1: Find out what cookies your site sets

Before you install anything, make a list. A good consent plugin will scan your site for you, or you can open your site in a private browser window and check the cookies under your browser’s developer tools (“Application” or “Storage”).

Look especially at:

  • Analytics (such as Google Analytics)
  • Embedded YouTube or Vimeo videos and Google Maps
  • Fonts loaded from outside your site
  • Facebook, Instagram or LinkedIn pixels and buttons
  • Chat widgets and booking tools

Step 2: Remove what you don’t need

The easiest cookie to manage is the one you don’t have. Old tracking codes from a past campaign, a social feed nobody looks at, or a plugin you stopped using can all go. For videos, the ICO suggests using a “privacy mode” where available, or simply linking to the video instead of embedding it. For fonts, hosting them on your own server avoids sending visitors’ information to a font provider.

Step 3: Choose a consent plugin

Pick a plugin that blocks non-exempt cookies until the visitor agrees, offers equal “Accept” and “Reject” buttons, lets people choose by category, and records consent.

Step 4: Set it up for UK rules

  • Select the UK (or UK GDPR/PECR) as your region if the plugin asks.
  • Put “Accept all” and “Reject all” on the first layer, with equal weight.
  • Group cookies into clear categories: necessary, statistics, preferences, marketing.
  • Make sure marketing cookies are off until someone opts in.
  • If you rely on the statistics or appearance exceptions, explain them and give people a simple way to switch them off. The ICO suggests this could be a toggle that’s on by default but easy to turn off.
  • Turn off any “consent by scrolling” or “consent by closing” options.

Step 5: Test it properly

Open your site in a private window and press “Reject all”. Then check the cookies again. If advertising or tracking cookies still appear, the banner isn’t doing its job. Test again after any new plugin or embed.

Step 6: Update your cookie and privacy information

Your cookie policy should list what you use, why, who sets it and how long it lasts. Make it easy for people to reopen their cookie settings later, often with a small link in your footer.

Common cookie banner mistakes to avoid

  • A banner that looks right but doesn’t block anything.
  • “Accept” as a big bright button, “Reject” hidden behind “Settings”.
  • Tracking codes added by a past web person that nobody remembers.
  • A cookie policy written years ago that no longer matches the site.
  • Two consent plugins installed at once, both half set up.

None of this is about frightening anyone. The ICO’s focus is on making sure people get a fair choice. For a small business, getting the basics right is very achievable.

For the bigger picture on data protection, see my plain-English guide to UK GDPR for WordPress websites.

How I can help at WonderlandSites

I look after WordPress websites; I’m not a lawyer, so I won’t tell you whether your set-up is legally compliant. What I can do is the technical side: on my hosting, every care plan includes weekly updates to WordPress, your plugins and your theme, then a check that your key pages still work. Your consent plugin is one of those plugins. If an update I run breaks something, I fix it free.

You can see what each plan includes, and what it doesn’t, on my plans page.

Not sure what your site is doing behind the scenes? Start with a free Website Check

Your free Website Check A plain-English report within 24 to 48 hours (Monday to Friday): an overall grade (A–F), what’s working, what isn’t, and your top 3 fixes in order. No login, no call, nothing changed on your site. Get your free Website Check

Then you decide what happens next. If you pressed “Reject all” on your own site today, do you know what would still load?

Frequently asked questions

Do I need a cookie banner on my UK website? If your site uses cookies that need consent, such as advertising or tracking cookies, you need a way to ask for it before they’re set. If you only use strictly necessary cookies, you don’t need consent, though you still need to explain them. This is general information, not legal advice.

Can I use Google Analytics without consent in the UK? Since February 2026, analytics used only to produce statistics for improving your website can be exempt from consent, if you explain it clearly and give people a simple way to object. The exception doesn’t cover tracking individuals or advertising, and a third-party tool must only use the data to help you. Check your set-up against the ICO’s guidance.

Does scrolling or closing the banner count as consent? No. Consent needs a clear, positive action, such as pressing “Accept”. Scrolling, carrying on browsing or closing the banner doesn’t count, and pre-ticked boxes aren’t valid either.


About the author Alleo Gordon, founder of WonderlandSites. Studied Computing at London South Bank; IT technician at a sixth form college in Bethnal Green for 3 years; looking after websites since 2018.

This article is general information, not legal advice. Sources: ICO guidance on the use of storage and access technologies (finalised 29 April 2026) and what are the exceptions?, read October 2026.

Whenever you’re ready, I’m here.

Tell me a little about where you are and where you’d like to be. I’ll reply personally.

Get in touch