Documentation – CookieBoxs | Free Cookie Consent Plugin for WordPress

CookieBoxs Documentation

Complete guide to setting up and configuring CookieBoxs — the free cookie consent plugin for WordPress with Google Consent Mode v2, automatic script blocker, and 25+ built-in integrations.

💡

New to CookieBoxs? Start with Installation, then run through the Quick Start Wizard. You'll be set up in under 5 minutes.

What's included for free

  • Google Consent Mode v2 — configurable defaults, URL passthrough, ads data redaction
  • Automatic Script Blocker — blocks third-party scripts before consent
  • 25+ Integrations — GA4, Meta Pixel, TikTok, Clarity, Hotjar, LiveChat, Intercom, and more
  • Content Blockers — placeholder overlays for YouTube, Vimeo, Google Maps
  • Consent Logging — full audit trail in your WordPress database
  • 11 Languages — EN, DE, FR, ES, IT, NL, PL, PT, CS, SV, UK
  • Region Presets — GDPR, CCPA, LGPD, UK GDPR, nDSG, PIPEDA
  • Cookie Cleaner — removes cookies when consent is rejected
  • Floating Badge — lets visitors change consent anytime

Installation

From WordPress Dashboard

1

Navigate to Plugins

Go to Plugins → Add New.

2

Search for CookieBoxs

Type CookieBoxs in the search bar.

3

Install & Activate

Click Install Now, then Activate. The wizard launches automatically.

Manual Installation

1

Download

Get the .zip from cookieboxs.com or WordPress.org.

2

Upload

Plugins → Add New → Upload Plugin, select the file, click Install Now.

3

Activate

Click Activate Plugin. You'll see the setup wizard.

Quick Start Wizard

1

Choose Region

Select your audience: EU (GDPR), US (CCPA), Brazil (LGPD), UK, Switzerland (nDSG), Canada (PIPEDA), or custom.

2

Select Language

11 languages available. All texts auto-populate.

3

Configure Consent Mode

Enable GCM v2, set defaults, enter GTM/GA4/Ads IDs.

4

Enable Integrations

Toggle services, enter pixel/account IDs.

5

Review & Activate

Preview banner, save, and go live.

ℹ️

Re-launch the wizard anytime: CookieBoxs → Settings → Tools.

Requirements

RequirementMinimumRecommended
WordPress5.8+6.4+
PHP7.4+8.1+
MySQL / MariaDB5.7 / 10.38.0 / 10.6
BrowsersChrome, Firefox, Safari, Edge

General Settings

  • Enable Plugin — master toggle for the consent banner
  • Consent Expiry — cookie storage duration (default: 365 days)
  • Script Blocker — automatic third-party script blocking
  • Cookie Cleaner — remove cookies when consent is denied
  • Content Blockers — placeholder overlays for embeds
  • Consent Logging — audit trail recording
  • Floating Badge — settings icon for consent changes

Appearance & Banner

  • Position — bottom bar, top bar, modal, or corner popup
  • Color Scheme — light, dark, or custom colors
  • Button Style — rounded/squared, filled/outlined
  • Backdrop Overlay — optional dark overlay
  • Animation — slide-in, fade-in, or none

Texts & Translations

Every string is customizable: title, description, buttons, category names, placeholder text, badge tooltip. Changing the language auto-fills defaults; your edits override them.

CategoryDefaultCan Disable?Description
FunctionalGrantedNoEssential site cookies
AnalyticsDeniedYesTraffic analysis (GA4, Clarity, Hotjar)
MarketingDeniedYesAdvertising & retargeting (Meta Pixel, Google Ads)

Region Presets

PresetRegionBehavior
EU GDPREuropean UnionOpt-in. All denied. Reject button required.
US CCPACaliforniaOpt-out. Analytics granted.
UK GDPRUnited KingdomOpt-in (UK guidance).
LGPDBrazilOpt-in with disclosure.
nDSGSwitzerlandInform & opt-out.
PIPEDACanadaImplied consent.
CustomAnyFull manual control.
⚠️

Legal disclaimer: Presets are sensible defaults, not legal advice.

Full GCM v2 included free. Communicates consent state to GA4, Google Ads, and GTM.

Signal Mapping

Google SignalCategoryControls
analytics_storageAnalyticsGA cookies
ad_storageMarketingAd cookies
ad_user_dataMarketingUser data for ads
ad_personalizationMarketingPersonalized ads
functionality_storageFunctionalFunctionality cookies
personalization_storageFunctionalPersonalization
security_storageFunctionalSecurity cookies

Advanced Options

  • URL Passthrough — preserves gclid/dclid when ad_storage is denied
  • Ads Data Redaction — redacts ad-click identifiers
  • Default State — per-signal defaults before user interaction
  • Wait for Update — delay (ms) before firing tags

Automatic Script Blocker

  1. Captures full HTML output via output buffering
  2. Scans for <script> tags with external src
  3. Categorizes third-party scripts
  4. Blocked: type="text/plain", srcdata-src
  5. Re-activated client-side when consent is granted

Safe domains (WP core, Google Fonts, Stripe, PayPal, reCAPTCHA, hCaptcha, Turnstile) are never blocked. Extend via filter:

PHP
add_filter( 'cookieboxs_safe_domains', function ( $domains ) {
    $domains[] = 'my-custom-cdn.com';
    return $domains;
} );

Integrations (25+)

Enable an integration, enter your ID, and scripts load automatically on consent.

Analytics & Tracking

📊 Google Analytics 4 FREE
🏷️ Google Tag Manager FREE
📈 Google Ads FREE
🔍 Microsoft Clarity FREE
🔥 Hotjar FREE
📉 Matomo FREE
📐 Yandex Metrica FREE
🧮 Heap Analytics FREE
🧪 Mixpanel FREE
🦔 PostHog FREE

Advertising

🔵 Meta Pixel FREE
🎵 TikTok Pixel FREE
💼 LinkedIn Insight FREE
📌 Pinterest Tag FREE
👻 Snapchat Pixel FREE
🐦 Twitter/X Pixel FREE
🔎 Microsoft UET FREE

Chat & Support

💬 LiveChat FREE
💭 Crisp FREE
🗨️ Tawk.to FREE
📩 Intercom FREE
⚠️

Avoid duplicate loading: If using CookieBoxs integrations, remove other plugins/snippets loading the same script.

Content Blockers

Blocks YouTube, Vimeo, and Google Maps iframes until consent. Shows a styled placeholder with an "Accept" button. Enable in General settings, customize text in Texts tab.

Records: timestamp, SHA-256 hashed IP, consent state, user agent, page URL. All data stays in your WordPress database.

Floating Badge

Persistent icon for reopening the consent dialog (GDPR requirement). Configure position, icon, and visibility in the Badge tab.

Removes third-party cookies in real time when consent is denied or withdrawn.

Cookie Scanner PRO

Two-phase automatic detection: (1) Server-side HTTP scan of your pages, (2) Browser-side iframe scan for JS-set cookies. All local — no external services.

Geo-Targeting PRO

Different consent behavior per region — strict opt-in for EU, simpler notice for US.

Premium Templates PRO

Additional banner designs with modern layouts and animations.

Consent Analytics PRO

Dashboard showing consent rates over 7/14/30/90 days.

Cookie Declaration PRO

Cookie list page via shortcode:

		

🔒 Necessary Always active

These cookies are essential for the website to function properly. They include remembering your consent preferences. They cannot be disabled.

No cookies detected in this category.

⚙️ Functional

These cookies enable additional functionality such as live chat, embedded media, or personalized widgets. Without them, some features may not be available.

No cookies detected in this category.

📊 Analytics

These cookies help us understand how visitors use our website by collecting anonymous statistics. This allows us to improve our content and services.

No cookies detected in this category.

📢 Marketing

These cookies are used to display personalized ads and measure the effectiveness of advertising campaigns. They may be set by third-party advertising networks.

No cookies detected in this category.

You can change your cookie preferences at any time by clicking the cookie icon. Manage cookies

White-Label Branding PRO

Remove or replace "Powered by CookieBoxs" with your own brand.

Custom CSS PRO

Add CSS from the settings panel without editing theme files.

CSV Export PRO

Export consent logs for audits and legal documentation.

Shortcodes

ShortcodeDescriptionPlan

🔒 Necessary Always active

These cookies are essential for the website to function properly. They include remembering your consent preferences. They cannot be disabled.

No cookies detected in this category.

⚙️ Functional

These cookies enable additional functionality such as live chat, embedded media, or personalized widgets. Without them, some features may not be available.

No cookies detected in this category.

📊 Analytics

These cookies help us understand how visitors use our website by collecting anonymous statistics. This allows us to improve our content and services.

No cookies detected in this category.

📢 Marketing

These cookies are used to display personalized ads and measure the effectiveness of advertising campaigns. They may be set by third-party advertising networks.

No cookies detected in this category.

You can change your cookie preferences at any time by clicking the cookie icon. Manage cookies

Cookie declaration tablePRO
[cookieboxs_reset]Consent reset buttonFREE

Custom reset buttons:

HTML
<a href="#" class="cookieboxs-reset-consent">Change cookie settings</a>

Hooks & Filters

FilterDescriptionParams
cookieboxs_safe_domainsModify safe domains for script blocker$domains (array)
cookieboxs_banner_outputFilter banner HTML before render$html (string)
cookieboxs_consent_categoriesModify consent categories$categories (array)

JavaScript API

JavaScript
// Read consent state
var consent = CookieBoxs.getConsent();
// { analytics: true, marketing: false, functional: true }

if ( CookieBoxs.hasConsent('analytics') ) {
    // Analytics consent granted
}

// Listen for changes
document.addEventListener('cookieboxs_consent_update', function(e) {
    console.log('New consent:', e.detail);
});

// Reset consent (clears cookie, reloads)
CookieBoxs.resetConsent();

Custom Scripts

PositionWhen
Head (before consent)Immediately, regardless of consent
Head (after consent)After consent category granted
Body (after consent)Before </body> after consent

Troubleshooting

Banner doesn't appear

  • Check plugin is enabled
  • Clear all caches
  • Delete cookieboxs_consent cookie
  • Check console for JS errors

Scripts loading without consent

  • Enable Script Blocker
  • Check if script injects after output buffer
  • Verify domain isn't in safe list

GA not tracking after consent

  • Remove duplicate GA4 snippets
  • Verify Measurement ID: G-XXXXXXXXXX
  • Check console after consent

Caching Compatibility

PluginNotes
WP RocketWorks. Check "Remove Unused CSS" doesn't strip styles.
LiteSpeedWorks. No config needed.
W3 Total CacheClear cache after activation.
CloudflarePurge after settings change.
💡

Always clear page cache after any CookieBoxs config change.

Changelog

3.0.7 — March 2026

  • Dedicated cookieboxs_sanitize_css() for CSS escaping
  • Refactored output buffer handling
  • Added cookieboxs_safe_domains filter
  • Security improvements

3.0.6 — February 2026

  • Removed HEREDOC/NOWDOC syntax
  • Improved nonce validation
  • Enhanced source code docs

3.0.0 — January 2026

  • Major rewrite — new admin UI, wizard, GCM v2, script blocker, content blockers, 25+ integrations, logging, 11 languages, region presets