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
Navigate to Plugins
Go to Plugins → Add New.
Search for CookieBoxs
Type CookieBoxs in the search bar.
Install & Activate
Click Install Now, then Activate. The wizard launches automatically.
Manual Installation
Download
Get the .zip from cookieboxs.com or WordPress.org.
Upload
Plugins → Add New → Upload Plugin, select the file, click Install Now.
Activate
Click Activate Plugin. You'll see the setup wizard.
Quick Start Wizard
Choose Region
Select your audience: EU (GDPR), US (CCPA), Brazil (LGPD), UK, Switzerland (nDSG), Canada (PIPEDA), or custom.
Select Language
11 languages available. All texts auto-populate.
Configure Consent Mode
Enable GCM v2, set defaults, enter GTM/GA4/Ads IDs.
Enable Integrations
Toggle services, enter pixel/account IDs.
Review & Activate
Preview banner, save, and go live.
Re-launch the wizard anytime: CookieBoxs → Settings → Tools.
Requirements
| Requirement | Minimum | Recommended |
|---|---|---|
| WordPress | 5.8+ | 6.4+ |
| PHP | 7.4+ | 8.1+ |
| MySQL / MariaDB | 5.7 / 10.3 | 8.0 / 10.6 |
| Browsers | Chrome, 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
PRO: Premium templates and custom CSS editor.
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.
Consent Categories
| Category | Default | Can Disable? | Description |
|---|---|---|---|
| Functional | Granted | No | Essential site cookies |
| Analytics | Denied | Yes | Traffic analysis (GA4, Clarity, Hotjar) |
| Marketing | Denied | Yes | Advertising & retargeting (Meta Pixel, Google Ads) |
Region Presets
| Preset | Region | Behavior |
|---|---|---|
| EU GDPR | European Union | Opt-in. All denied. Reject button required. |
| US CCPA | California | Opt-out. Analytics granted. |
| UK GDPR | United Kingdom | Opt-in (UK guidance). |
| LGPD | Brazil | Opt-in with disclosure. |
| nDSG | Switzerland | Inform & opt-out. |
| PIPEDA | Canada | Implied consent. |
| Custom | Any | Full manual control. |
Legal disclaimer: Presets are sensible defaults, not legal advice.
Google Consent Mode v2
Full GCM v2 included free. Communicates consent state to GA4, Google Ads, and GTM.
Signal Mapping
| Google Signal | Category | Controls |
|---|---|---|
analytics_storage | Analytics | GA cookies |
ad_storage | Marketing | Ad cookies |
ad_user_data | Marketing | User data for ads |
ad_personalization | Marketing | Personalized ads |
functionality_storage | Functional | Functionality cookies |
personalization_storage | Functional | Personalization |
security_storage | Functional | Security 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
- Captures full HTML output via output buffering
- Scans for
<script>tags with externalsrc - Categorizes third-party scripts
- Blocked:
type="text/plain",src→data-src - 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:
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
Advertising
Chat & Support
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.
Consent Logging
Records: timestamp, SHA-256 hashed IP, consent state, user agent, page URL. All data stays in your WordPress database.
PRO: CSV export and visual analytics dashboard.
Floating Badge
Persistent icon for reopening the consent dialog (GDPR requirement). Configure position, icon, and visibility in the Badge tab.
Cookie Cleaner
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:
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
| Shortcode | Description | Plan |
|---|---|---|
| Cookie declaration table | PRO |
[cookieboxs_reset] | Consent reset button | FREE |
Custom reset buttons:
<a href="#" class="cookieboxs-reset-consent">Change cookie settings</a>
Hooks & Filters
| Filter | Description | Params |
|---|---|---|
cookieboxs_safe_domains | Modify safe domains for script blocker | $domains (array) |
cookieboxs_banner_output | Filter banner HTML before render | $html (string) |
cookieboxs_consent_categories | Modify consent categories | $categories (array) |
JavaScript API
// 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
| Position | When |
|---|---|
| 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_consentcookie - 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
| Plugin | Notes |
|---|---|
| WP Rocket | Works. Check "Remove Unused CSS" doesn't strip styles. |
| LiteSpeed | Works. No config needed. |
| W3 Total Cache | Clear cache after activation. |
| Cloudflare | Purge 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_domainsfilter - 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
