← Back|
C
Cookiestack
Sign inGet started

Cookie Banner for WordPress

Last updated: November 3, 2026

The WordPress plugin directory has dozens of cookie plugins, but many of them only show a notice and don't actually block scripts until consent, hide the reject button, or keep no consent log. Installing one "just to have a banner" leaves the banner visible while the site still doesn't meet GDPR and ePrivacy requirements.

Option 1: no plugins, via the theme

The most reliable approach is adding the tag under Appearance → Theme Editor → header.php, right before the closing </head> tag:

<script
  src="https://consent.worklinelabs.eu/widget.js"
  data-api-key="YOUR_API_KEY"
  async
></script>

If the theme gets auto-updated, create achild themefirst — otherwise the header.php edit gets wiped on the next theme update.

Option 2: no code edits

If theme editor access is blocked (some hosts disable it for security), use any lightweight "insert code into head" plugin with no cookie-banner logic of its own, and add the same script tag there. Just don't run a separate cookie-consent plugin alongside it — two banners on the same page conflict visually and confuse visitors.

WooCommerce and plugins with their own cookies

WooCommerce, caching plugins, and analytics plugins (Jetpack Stats, MonsterInsights, etc.) often set cookies independently of any banner. Strictly necessary cookies (e.g. the WooCommerce cart) generally don't need consent. Analytics or marketing scripts from those plugins are a different story — if they're embedded as a static tag in the theme or via another plugin, wrap them with type="text/plain" anddata-cookie-category="statistics" (or marketing) — see theJavaScript API for details.

Google Analytics via plugins

If Google Analytics or Google Ads are wired up through Site Kit or another plugin, enable Google Consent Mode v2 in your Cookiestack domain settings — the widget sets the default consent state before Google tags load and updates it after the visitor's choice. See the Google Consent Mode v2 guide for details.

Start for free →

This article is for informational purposes only and is not legal advice. WordPress admin panel layout varies by version and active theme.

Cookie Banner for WordPress