How to Add a Cookie Consent Banner to WordPress (2026): GDPR & CCPA Without Slowing Your Site

In this guide

If your WordPress site uses Google Analytics, AdSense, YouTube embeds, or a Facebook Pixel, it sets cookies on your visitors’ browsers — and under European privacy law, most of those cookies need the visitor’s permission first.

This guide shows you how to add a cookie consent banner to WordPress in 2026, step by step, without hiring a developer. We compare the four realistic methods and walk through the recommended free setup.

If you run ads, this matters twice: Google requires a certified consent platform for personalised ads in Europe, and a broken banner can quietly cut your AdSense revenue. Learning how to add a cookie consent banner to WordPress takes about twenty minutes.

A cookie consent banner turns a legal requirement — get permission before tracking — into something a visitor can do in two seconds. WordPress itself sets very few cookies; the tracking comes from Analytics, AdSense, and marketing pixels.

That rule applies even if you are not based in Europe: GDPR covers any site serving visitors in the European Economic Area, and California’s law covers its residents. A clear, honest banner also builds trust.

What the Law Actually Requires

GDPR and the ePrivacy Directive (Europe)

Under GDPR, consent must be freely given, specific, informed, and unambiguous. In practice: no non-essential cookie may load before the visitor consents (prior blocking); Reject must be as easy as Accept; and consent must be as easy to withdraw as to give. Fines can reach €20 million or 4% of global turnover, and authorities in France, Spain, and Germany regularly fine small publishers for banners without a Reject button.

CCPA and CPRA (California)

California works differently. The CCPA and its successor, the CPRA, use an opt-out model: you need not ask permission before setting cookies, but you must disclose what you collect and give California residents a clear “Do Not Sell or Share My Personal Information” link.

Since March 2024, Google has required Consent Mode v2 for any site using Google Ads, AdSense, or Google Analytics with traffic from the EEA, the UK, or Switzerland. It sends Google four consent signals — ad_storage, ad_user_data, ad_personalization, and analytics_storage — which must default to denied until the visitor consents. On acceptance they flip to granted; on rejection Google switches to cookieless measurement.

There is a second requirement: since 16 January 2024, sites serving personalised ads to EEA, UK, or Switzerland traffic through AdSense, Ad Manager, or AdMob must use a Google-certified CMP. The three plugins in this guide are all certified.

Skip this and Google restricts personalised ads for your European traffic, which means lower ad rates and lower revenue. A banner that loads after your AdSense code has the same effect as no banner at all. If you run Analytics through Tag Manager, read our guide to adding Google Tag Manager to WordPress first.

There are four realistic ways to learn how to add a cookie consent banner to WordPress, and the right one depends on your traffic, your budget, and how much control you want.

Method Cost to start Best for Consent Mode v2 Page-view cap
CookieYes plugin Free Most sites; best free start Yes, on every plan 5,000/mo on Free
Complianz plugin Free WordPress-only sites, legal documents Premium only ($59/yr) None
GDPR Cookie Consent (WebToffee) Free WooCommerce and high-traffic sites Yes, on every plan None
Manual code / theme-based Free Developers, single-purpose banners Only if you code it None

All three plugins offer a genuinely usable free version on WordPress.org.

Plugin Free plan Entry paid plan Page-view cap Google-certified CMP
CookieYes $0, 5,000 pageviews/mo Basic $10/mo ($100/yr) 5,000/mo on Free Yes
Complianz $0, banner and blocking Personal $59/yr (1 site) None Yes
GDPR Cookie Consent (WebToffee) $0, banner and logging Single Site $69/yr None Yes

CookieYes is our recommended starting point: the most popular cookie consent plugin on WordPress.org, with more than a million active installs, and a Google-certified CMP. The fastest way to learn how to add a cookie consent banner to WordPress is to follow these six steps.

The free plan costs $0 (5,000 pageviews a month, 100 pages per scan) and includes Google Consent Mode v2 free. Basic is $10 a month per domain ($100 a year) for 100,000 pageviews; Pro is $25 a month ($250 a year) with geo-targeting and IAB TCF v2.2; Ultimate is $55 a month ($550 a year) with unlimited pageviews. Annual billing gives two months free; paid plans include a 14-day free trial.

Step 1: Install and activate the plugin

From your WordPress dashboard, go to Plugins, then Add New, search for “CookieYes”, and install and activate it — or install it from the plugin’s WordPress.org page.

Step 2: Create your free CookieYes account

After activation, connect a free CookieYes account with an email address and password. The account holds your cookie scan results and consent logs.

In the CookieYes dashboard, run a scan of your site: the free plan scans up to 100 pages. The scan finds every cookie your site sets and sorts them into categories — review the results before publishing.

Step 4: Customise the banner text and design

Edit the banner message, button labels, and colours. Keep the message short and plain, and make Reject as visible as Accept.

In the CookieYes settings, turn on Google Consent Mode v2. With it on, CookieYes sends the four consent signals to Google before any Google tag fires.

Step 6: Publish and test

Click Publish, then visit your site in a private browser window. Click Reject and check that analytics and ads do not fire, then click Accept and confirm they do.

Method 2: Complianz — Best WordPress-Native Option

Complianz is the most WordPress-native of the three plugins, and the only one that also generates the legal documents around the banner. If you want to learn how to add a cookie consent banner to WordPress with a plugin that also writes your legal pages, this is the one.

The free plugin on WordPress.org covers the banner, cookie and script blocking, and a setup wizard. Paid plans are annual licences: Personal $59 a year for one site, Professional $179 a year for five, and Agency $399 a year for 25. There is no page-view cap, and consent records are unlimited.

Two catches matter. Google Consent Mode v2, geo-targeting, consent records, and A/B testing are all Premium-only, so the free version shows a banner but sends no consent signals to Google. Complianz also lists its prices in euros (€59, €179, €399), so check the live price at checkout. Find it on the plugin’s WordPress.org page.

WebToffee’s GDPR Cookie Consent plugin is the best pick for WooCommerce stores and high-traffic sites: no page-view cap on any plan, free or paid, which makes it a strong answer to how to add a cookie consent banner to WordPress on a busy site.

The free version on WordPress.org covers the banner, basic cookie categories, and consent logging. Premium starts at $69 a year for a single site, $199 a year for up to five, and $399 a year for up to 25. Every plan includes Google Consent Mode v2, IAB TCF v2.4, automatic script blocking, geo-targeting, and a 30-day money-back guarantee.

The plugin is a Google-certified CMP with one-click Consent Mode setup, and its WooCommerce integration does not block the cookies the cart needs.

Method 4: The Manual Code Method

You can learn how to add a cookie consent banner to WordPress without any plugin, by adding code to your theme or a code-snippets plugin: a banner in HTML and CSS, a JavaScript file that stores the visitor’s choice, and logic that blocks your analytics and ad scripts until consent is granted.

The advantage is total control and zero added weight — no plugin files, no external dashboard, no subscription. The disadvantage is everything else: you must implement prior blocking yourself, wire up Consent Mode v2 by hand, and update the code whenever the law or Google’s requirements change.

Use the manual method only if you are comfortable editing theme files and your site’s tracking is simple — Analytics and nothing else. For everyone else, a plugin is cheaper than the developer time a manual banner costs.

Every consent plugin organises cookies into categories. Getting them right is what makes your banner honest — it is the part of learning how to add a cookie consent banner to WordPress that most site owners rush, and the part regulators check first.

Category Examples Needs consent? Default state
Necessary Login sessions, security, load balancing, cart No Always on
Preferences Language, region, display settings Yes Off until accepted
Analytics Google Analytics, Search Console data Yes Off until accepted
Marketing AdSense, Facebook Pixel, remarketing Yes Off until accepted
Functional Embedded videos, maps, chat widgets Yes Off until accepted

Necessary cookies are the only category that may load before consent. Everything else stays blocked until the visitor opts in — filing an analytics cookie under Necessary is a dark pattern.

Give visitors granular control. A banner with only “Accept all” and “Reject all” is legal, but a “Customise” option that opens the category toggles is what GDPR expects — and most visitors who open the panel accept analytics while rejecting marketing.

Geo-Targeting: Show the Banner Only Where It Is Needed

Geo-targeting shows different banners — or no banner at all — depending on where the visitor is located: Germany sees the full GDPR banner, California a shorter notice with the “Do Not Sell or Share” link. It is an optional extra when you learn how to add a cookie consent banner to WordPress, but it separates a basic setup from a professional one.

CookieYes includes geo-targeting from the Pro plan ($25 a month); Complianz and WebToffee include it in their paid plans. The free tiers show the same banner to everyone. Test geo-targeting with a VPN before you trust it: a misconfigured region rule can hide the banner from the very visitors the law protects.

Designing a Banner Visitors Actually Accept

A banner’s design decides whether visitors accept, reject, or simply leave. Clear banners with equal buttons get more acceptances than aggressive ones. Design is the final step in learning how to add a cookie consent banner to WordPress that visitors do not hate.

Make Accept and Reject the same size, weight, and visual prominence. A tiny grey Reject link beside a large coloured Accept button is the most common reason banners get fined in Europe.

Place the banner at the bottom of the screen, full width on mobile and a compact bar on desktop. Avoid a full-screen modal.

Close-up of a cookie consent banner with Accept, Reject and Customise buttons

Every consent banner needs a cookie policy page behind it: a plain-language page listing the cookies your site uses, what each one does, and how long it lasts. Any guide on how to add a cookie consent banner to WordPress that skips this page is incomplete.

The fastest way to create one is to let your plugin generate it: Complianz does so automatically from its scan, and CookieYes and WebToffee both include a policy generator.

Link the policy page in three places: from the banner itself, from your privacy policy, and from your footer. A visitor who wants to change consent later needs a way back — most plugins add a small “Cookie settings” link in the footer or a floating button. Our guide to adding a sitemap to WordPress explains how new pages get discovered and indexed.

Testing and Verifying Your Banner Works

A banner that looks right can still be broken underneath, so testing is a mandatory step when you learn how to add a cookie consent banner to WordPress.

First, open your site in a private window: the banner should appear before any analytics or ad request fires. In your browser’s developer tools, reload on the Network tab without touching the banner — you should see no requests to google-analytics.com, doubleclick.net, or facebook.com.

Second, click Reject and confirm that analytics and ads do not load. Third, click Accept on a fresh visit and confirm they load and the four Consent Mode signals read granted.

Fourth, find the “change consent” control — usually a footer link or a small floating button — and confirm it reopens the preferences panel. Finally, re-test after every change to your tracking setup. Make the banner test part of your launch checklist, alongside the items in our WordPress security checklist.

Common Mistakes That Break Compliance

Most cookie banners fail for the same handful of reasons. Even site owners who know how to add a cookie consent banner to WordPress make these mistakes.

The biggest mistake is loading tracking scripts before consent. If your Analytics or AdSense code fires on page load from your theme header, your plugin cannot block it — move it into Tag Manager or the plugin’s script manager.

The second mistake is a missing or hidden Reject button. A banner with only “Accept” and “Customise” is not compliant in Europe, because the visitor cannot refuse in one click.

The third mistake is pre-ticked boxes in the preferences panel. Consent must be an active choice, so every non-essential category must start switched off.

The fourth mistake is forgetting the consent log: if a regulator asks what a visitor consented to and when, you need a record. All three plugins keep consent logs on their paid plans.

The fifth mistake is never updating the banner: you add a chat widget or a new ad network, and the banner keeps describing the old cookie list.

Performance: Keeping Your Banner Light and Fast

A consent banner is JavaScript, and JavaScript costs speed. But a well-chosen plugin costs very little. Performance is the last thing to check when you learn how to add a cookie consent banner to WordPress.

First, pick a plugin that loads its script locally. Complianz and WebToffee run entirely inside WordPress, so there is no extra third-party request — CookieYes loads part of its service from its own servers.

Second, do not load the banner script on pages that do not need it: most plugins let you disable the banner on specific pages.

Third, keep the banner’s assets small: no large background image or custom font. Use your theme’s font and colours instead.

Fourth, measure the impact: test your page speed before and after installing the plugin, on mobile. A good setup adds well under 100 milliseconds.

A WordPress admin settings screen for a cookie consent plugin with category toggles

Our Verdict

After testing all four methods, the answer to how to add a cookie consent banner to WordPress is simple: pick a certified plugin, switch on Consent Mode v2, and test the Reject path as carefully as the Accept path.

Verdict: CookieYes is the best way to learn how to add a cookie consent banner to WordPress for most site owners in 2026, because its free plan costs $0, includes Google Consent Mode v2, and covers up to 5,000 pageviews a month — enough to get a new site fully compliant in twenty minutes. When your traffic grows past that limit, upgrade to Basic at $10 a month, or switch to Complianz Personal at $59 a year if you want legal documents and no page-view meter, or to WebToffee at $69 a year if you run WooCommerce or a high-traffic site. Whichever plugin you choose, the rule is the same: the banner must load before your tracking scripts, Reject must be as easy as Accept, and Consent Mode v2 must be switched on.

Frequently Asked Questions

Probably not — but you cannot know that without analytics, and analytics itself sets cookies. Most owners who learn how to add a cookie consent banner to WordPress show the banner to everyone or use geo-targeting.

Yes, for traffic from the EEA, the UK, and Switzerland, where Google requires a certified CMP and Consent Mode v2 for personalised ads. A missing banner can restrict your ads to non-personalised ones, which usually pay less. Knowing how to add a cookie consent banner to WordPress correctly is what keeps those ads personalised. Our guide to adding AdSense to WordPress covers the rest.

Yes. CookieYes, Complianz, and WebToffee all offer free versions on WordPress.org with a working banner and consent categories, and CookieYes’s free plan is the most complete for ad-funded sites because it includes Google Consent Mode v2 at no cost.

Barely: a good consent plugin adds well under 100 milliseconds to page load, so learning how to add a cookie consent banner to WordPress costs you almost no speed.

The risks are fines, lost ad revenue, and lost trust: regulators can fine sites up to €20 million or 4% of global turnover, and Google restricts personalised ads for European traffic when no certified CMP is in place.

Every good consent plugin adds a way back, usually a “Cookie settings” link in the footer or a small floating button. Clicking it reopens the preferences panel, where visitors can change any category. Test this control yourself — if visitors cannot find it, your consent is not genuinely withdrawable. Our guide to adding Google Analytics to WordPress explains the analytics side.

Prices verified 21 November 2026 from the vendors’ official pricing pages and WordPress.org listings: cookieyes.com/pricing, complianz.io/pricing, and webtoffee.com/product/gdpr-cookie-consent/. Prices change over time, so confirm the current price on the vendor’s pricing page before you buy. This article is general guidance, not legal advice — privacy rules vary by jurisdiction, so consult a lawyer for advice specific to your site.

Leave a Comment