Skip to content

CMS · Install guide

Cookie consent for WordPress

Updated

Add one script to your theme's header and Kiescy shows a consent banner that follows each visitor's law, blocks trackers until they agree and sends Google Consent Mode v2 signals. Works with any theme, including block themes, Elementor and Divi.

Setup time
About 5 minutes
Coding
None: copy and paste
Laws covered
GDPR, UK GDPR, CCPA, DPDP
Google Consent Mode v2
Built in, basic or advanced

Set up cookie consent on WordPress in 3 steps

  1. Create a free accountAdd your website. Kiescy scans it and finds the trackers that need consent.
  2. Paste one script into WordPressYour banner appears and starts holding back trackers until visitors choose.
  3. Check it worksOpen your site in a private window and run the free check to confirm nothing loads early.

Why WordPress sites need cookie consent

WordPress runs over 40% of the web, and the average site adds analytics, ad pixels, embeds and forms through plugins. Each plugin can add trackers you never chose explicitly, which is why a scan plus a banner that blocks by category matters more here than anywhere.

Your options on WordPress

ApproachGood forWatch out for
A consent plugin (Complianz, CookieYes, Cookie Notice)Managing everything inside wp-adminAnother plugin to update; regional rules, records and Consent Mode v2 vary by plugin and plan
Theme or snippet bannerDevelopersUsually a notice only: no blocking, no records
Kiescy scriptSites that also need policies, a request form and monitoring in one placeGive it top priority so it prints before other plugins' tags

Add your privacy policy

Create a page called Privacy Policy, switch to the code editor (or add a Custom HTML block), and paste the embed. Then set it as your privacy page under Settings → Privacy.

Custom HTML block
<div data-kiescy-doc="privacy"></div>
<script src="https://script.kiescy.com/embed/policy/YOUR_SITE_KEY.js" async></script>

Good to know

Put the banner script first so it can hold back trackers that other plugins add, such as Site Kit, MonsterInsights or the Meta Pixel. Caching plugins are fine: the banner decides on the visitor's device, not on the server.

Check that it works

Open your site in a private window: the banner should appear for a first-time visitor. Then run the free privacy check, which opens your site as a new EU visitor and lists anything that still loads before consent.

Kiescy's monitoring repeats that check on a schedule and emails you if a new script starts tracking before consent.

What your WordPress visitors see

Kiescy detects where each visitor is and shows the version their law requires, so you don't have to choose between the strictest banner for everyone and no banner at all.

GoodEU, UK, India and other opt-in regions: an opt-in banner. Analytics, ad pixels and embeds wait until the visitor agrees; Reject is as easy as Accept. Banner text: We value your privacy. We use cookies to run this site and, with your permission, to measure visits and show relevant ads. Buttons: Accept all, Reject all, Customise.
GoodCalifornia and other US states: an opt-out notice with a "Do Not Sell or Share" link, and Global Privacy Control honoured automatically. Banner text: Your privacy choices. We share some data with advertising partners. You can opt out at any time. Buttons: Do Not Sell or Share My Personal Information, OK.

Trackers WordPress sites usually load

These are the tools that most often need consent on WordPress sites, and how Kiescy treats them. Run a cookie scan to see exactly what yours loads.

ToolCategoryWhat happens
Google Site Kit / Google Analytics 4AnalyticsAdds gtag.js site-wide; held back until analytics consent
MonsterInsights, ExactMetricsAnalyticsAlso load Google Analytics
Jetpack StatsAnalyticsLoads stats from WordPress.com
Meta Pixel / Facebook for WooCommerceAdvertisingNeeds consent in the EU, opt-out in California
Hotjar, Microsoft ClarityAnalyticsSession recording and heatmaps
Embedded YouTube, Vimeo, Google MapsSocial / performanceSet third-party cookies when they load
WooCommerce cart and sessionEssentialNeeded for the cart; no consent required

Cookies WordPress sets itself

Besides the tools you add, WordPress sets some cookies of its own. Essential ones don't need consent, but they belong in your cookie policy.

CookiePurposeCategory
wordpress_logged_in_*Keeps logged-in users signed inEssential
wordpress_test_cookieChecks the browser accepts cookies at loginEssential
wp-settings-*Remembers admin screen preferences for logged-in usersEssential (functional)
comment_author_*Remembers a commenter's name and email, only if they tick the boxFunctional
woocommerce_cart_hash, woocommerce_items_in_cart, wp_woocommerce_session_*Cart contents and sessionEssential
sbjs_*WooCommerce order attribution (where an order came from)Analytics

Names and lifetimes change over time, so treat this as a guide and rely on your own scan for your cookie policy.

Troubleshooting

The banner doesn't appear after I added the script

A caching plugin or CDN is probably still serving the old page. Clear the cache in WP Rocket, LiteSpeed Cache, W3 Total Cache or your host's panel, then open the site in a private window.

Google Analytics still loads before consent

Another plugin is printing gtag.js above Kiescy. In WPCode, give the Kiescy snippet priority 1 so it prints first, or move it directly after <head> in header.php.

My optimization plugin broke the banner

"Delay JavaScript execution" and "Combine JS" features can postpone the banner until after trackers run. Add the Kiescy script URL (script.kiescy.com, or api.kiescy.com if your tag still uses it) to the plugin's exclusion list.

Visitors see two cookie banners

Deactivate your previous consent plugin (Complianz, CookieYes, Cookie Notice, Borlabs) once Kiescy is live.

Compliance checklist for WordPress

  • A consent banner that blocks non-essential trackers until the visitor agrees (opt-in for the EU, UK and India).
  • A "Do Not Sell or Share" option for California visitors, and Global Privacy Control honored.
  • A privacy policy that names the tools above, linked from every page.
  • A cookie policy listing the cookies your scan finds.
  • A way for people to request, correct or delete their data.
  • Records of each consent choice, kept as proof.
  • Set your privacy policy page under Settings → Privacy so WordPress links it on the login and registration screens.
  • If you run WooCommerce, link your terms, refund and shipping policies at checkout.

Guides for WordPress site owners

Questions

Do I need to remove my current cookie plugin?

Yes. Running two consent tools at once leads to two banners and conflicting choices. Remove the old plugin after Kiescy is live.

Will it work with WP Rocket or LiteSpeed Cache?

Yes. If you defer or delay JavaScript, exclude the Kiescy script so it can load first.

Does it block Google Analytics added by Site Kit?

Yes. Once a cookie scan finds Google Analytics, Kiescy holds its script back until the visitor allows analytics, and it sends Google Consent Mode signals either way.

Do I need a cookie banner on WordPress?

If visitors come from the EU, UK or India and your site uses analytics, ads or embedded videos, yes. A plain WordPress site with no plugins only sets essential login cookies, but almost every site adds something that needs consent.

Does it work on WordPress.com?

On WordPress.com you need a plan that allows plugins or custom code (Business or higher) to add a header script.

Official WordPress documentation

Menus move. If a step above doesn't match what you see, WordPress's own docs show the current way to add code.

Get compliant this afternoon, not this quarter.

Set up your policies, banner and request form in one place. Free while Kiescy is in early access.