Getting started
ShieldConsent is a WordPress plugin that handles cookie consent, script blocking, and legal proof of consent — entirely from your own server. No cloud, no external API, no data leaving your infrastructure.
Requirements
- WordPress 6.0 or higher
- PHP 7.4 or higher (8.0+ recommended)
- MySQL 5.7+ or MariaDB 10.3+
Installation
Upload the plugin ZIP from Plugins → Add New → Upload Plugin, then activate it. The Setup Wizard starts automatically on first activation.
Setup Wizard
The wizard runs the first time you activate the plugin. You can re-run it any time from ShieldConsent → Settings → Setup Wizard.
Steps
- Welcome — Quick overview.
- Regulations — Pick which privacy laws apply (GDPR, UK GDPR, CCPA, LGPD, Loi 25, nFADP). Each maps visitors from its region to the correct consent mode.
- Protection — Choose how scripts are blocked: signals only (Mode A), standard blocking (Mode B), or advanced/e-commerce (Mode C).
- Appearance — Banner title, text, position, and accent color.
- Analytics — GA4 Measurement ID and/or GTM Container ID. Enable Google Consent Mode v2.
- Categories — Enable or disable categories, edit their descriptions.
- Compliance — Data controller info, DPO, supervisory authority, privacy policy URL, consent duration. Optionally create the Cookie Policy page.
- Scan — Run your first cookie scan.
- Finish — Summary with a compliance score and next steps.
Every setting can be changed later. The wizard just gives you a guided starting point.
Protection modes
Three levels of script blocking, configured under Settings → Protection.
Mode A — Signals only
Sends Google Consent Mode signals (granted/denied) without blocking any scripts. Third-party scripts continue to load normally. Best for simple sites that only use Google services and rely on Google to respect the signals.
Mode B — Standard blocking
Blocks third-party scripts by category (analytics, marketing, bot protection) until the visitor gives consent. Scripts are detected by domain and neutralized server-side in the HTML buffer before the page reaches the browser. This is the recommended mode for most sites.
Mode C — Advanced blocking (e-commerce)
Everything in Mode B, plus a smart whitelist for WooCommerce. Automatically detects checkout, cart, and account pages and unblocks payment gateways (Stripe, PayPal, Klarna, Mollie, Braintree, Square, Razorpay, Google Pay, Apple Pay and more) so checkout is not disrupted by consent requirements. You can also allow reCAPTCHA without consent.
Google Consent Mode v2
ShieldConsent sends consent signals automatically to Google services based on the visitor's choice. Required since March 2024 for EU ad measurement.
Signals sent
ad_storage— Advertising cookies (Google Ads, remarketing).analytics_storage— Analytics cookies (GA4).ad_user_data— User data for advertising purposes.ad_personalization— Personalized advertising.functionality_storage— Functional cookies.personalization_storage— Personalization cookies.security_storage— Security cookies.
Enable it under Settings → Analytics with your GA4 Measurement ID and/or GTM Container ID. No manual tag configuration needed.
Content Blocker
Automatically detects and blocks third-party iframes, replacing them with a consent placeholder that matches the original dimensions.
Supported services
- Video: YouTube, Vimeo, Dailymotion, TikTok, Twitch, Wistia, Loom, Rumble, Vidyard
- Social: X (Twitter), Instagram, Facebook, Pinterest, LinkedIn, Reddit, Threads
- Audio: Spotify, SoundCloud, Apple Podcasts, Deezer, Anchor
- Maps: Google Maps, OpenStreetMap
When the visitor consents to the relevant category, the original iframe is restored. YouTube embeds show a video thumbnail in the placeholder.
Geolocation
Detects the visitor's country and automatically applies the correct consent mode per region.
Detection methods
- CDN/proxy headers — Cloudflare
CF-IPCountry, Vercel, etc. - Geolocation API — Configurable external API endpoint.
- Server GeoIP header — Server-level headers set by your hosting provider.
Recognized regions
- EU + EEA (30 countries) — Opt-in (GDPR).
- UK + Switzerland — Opt-in.
- Brazil — Opt-in (LGPD).
- US states with privacy laws — California (CCPA/CPRA), Virginia (VCDPA), Colorado (CPA), Connecticut (CTDPA), Montana (MCDPA), and more as legislation evolves. Opt-out + GPC enforcement.
Page caching compatibility
When geolocation is enabled, ShieldConsent signals caching plugins to bypass full-page caching via DONOTCACHEPAGE, Cache-Control: no-store headers, and plugin-specific hooks (WP Rocket, LiteSpeed, Kinsta, Cloudflare APO). A runtime geo-fix script corrects the consent mode if a stale cached version is served.
Languages & RTL
The banner detects the visitor's browser language and shows the matching translation. Arabic visitors get proper RTL layout automatically.
Add translations for any language from Settings → Translations. 53 languages are available in total:
36 languages with one-click auto-fill: English (US + GB), Bulgarian, Croatian, Czech, Danish, Dutch, Estonian, Finnish, French, German, Greek, Hungarian, Irish, Italian, Latvian, Lithuanian, Maltese, Norwegian, Polish, Portuguese (PT + BR), Romanian, Slovak, Slovenian, Spanish, Swedish, Welsh, Arabic, Chinese (Simplified & Traditional), Hebrew, Hindi, Japanese, Turkish, and Vietnamese.
17 additional languages with manual entry: Albanian, Basque, Bosnian, Catalan, Filipino, Galician, Icelandic, Indonesian, Korean, Luxembourgish, Macedonian, Malay, Persian, Russian, Serbian, Thai, and Ukrainian. Select the language, fill in the banner and modal fields, and the consent banner will display in that language for matching visitors.
Need a language not listed above? Use the custom locale field to add any locale code manually.
Accept-Language header. Check your browser's language preferences (Chrome: Settings → Languages; macOS: System Settings → General → Language & Region → Preferred Languages). Each browser manages its own list independently from the OS. Extensions are disabled in incognito/private mode, which can cause different behavior. Clear your cache and reload after correcting.
IAB TCF 2.3
ShieldConsent implements the IAB Transparency & Consent Framework 2.3, including the CMP API (window.__tcfapi) and the consent string (TC string) required by participating vendors.
Enable it under Settings → Advanced → TCF.
Consent Logs & storage
Where is consent data stored?
- Browser cookies — An HttpOnly server-side cookie (source of truth) and a JavaScript-readable cookie (UI state).
- WordPress database — A dedicated table (
wp_shieldconsent_logs). No data is sent to external servers.
Retention
Configurable in Settings → Legal. Old records are automatically deleted via WP-Cron. You can also delete records manually at any time.
Data integrity
Each consent record includes a SHA-256 integrity hash. Consent records are stored as standard database rows — the website operator retains full control.
Is ShieldConsent a data processor?
No. ShieldConsent does not transmit, receive, or store any consent data on external servers. All data stays on your infrastructure. There are no third-party data transfers to justify under GDPR Article 28.
Legal Proof & Audit
Individual consent proof
Each consent event generates a document containing the visitor's decision, timestamp, exact banner and category texts (in the visitor's language), policy version, and SHA-256 integrity hash. Download as PDF or HTML.
Legal ZIP bundle
An audit-ready package containing: consent dossier (CMP setup overview), settings snapshot, cookie catalog, and all consent logs. Supports GDPR Article 5 (accountability).
Audit Log
A journal of consent activity with filters, exports (CSV/JSON), and formal audit generation (PDF/HTML). Access it under ShieldConsent → Audit Log.
composer require dompdf/dompdf. Without it, ShieldConsent falls back to HTML — same content, different format. You can also use Print → Save as PDF from any browser.
Dashboard & statistics
The dashboard under ShieldConsent → Dashboard shows:
- Consent rate over time (7, 30, 90, or 365 days)
- Decision distribution (accepted / refused / custom)
- Category acceptance rates
- Device breakdown (desktop / mobile / tablet)
- Hourly activity
- Language breakdown
- Source breakdown (banner / modal / floating button)
- Compliance score (checks your configuration against best practices)
Shortcodes
[shieldconsent_manage_consent]
Renders a "Manage cookies" button that reopens the consent modal. Attributes: label (button text), tag (button or a), class (CSS class).
[shieldconsent_cookies_table]
Displays a table of cookies from your scan results, grouped by category. Attribute: category (filter by a specific category key).
[shieldconsent_consent_proof]
Shows the current visitor's consent status: decision, timestamp, categories, and a link to modify preferences.
[shieldconsent_cookie_policy]
Generates a full cookie policy page with intro, cookie table, data transfer section, browser instructions, and outro.
WooCommerce
ShieldConsent includes a smart whitelist for WooCommerce (requires Protection Mode C).
What it does
- Auto-detects checkout, cart, and account pages.
- Unblocks Stripe, PayPal, Klarna, Mollie, Braintree, Square, Razorpay, Google Pay, Apple Pay and more on those pages.
- Optionally allows reCAPTCHA without consent.
No configuration needed — activate Mode C and WooCommerce pages are handled automatically.
Script whitelisting
Beyond WooCommerce, you can add custom managed endpoints (URL patterns always allowed through) and assign scripts to the strictly_necessary category so they're never blocked.
Import / Export
Export your entire ShieldConsent configuration as a JSON file from Settings → Import/Export. Import it on another site to replicate your setup — categories, appearance, protection mode, compliance settings, translations, and managed endpoints.
Useful for agencies managing multiple client sites with a consistent configuration.
Diagnostics
The Diagnostics page under ShieldConsent → Settings helps you detect issues:
- Google Site Kit detection — Warns if Site Kit may inject tracking independently of ShieldConsent.
- Competing plugins — Detects MonsterInsights, ExactMetrics, Insert Headers and Footers, etc.
- Database schema — Checks if the consent logs table is correctly created.
- Front-end scan — Fetches your home page HTML and looks for Google Fonts, reCAPTCHA, GTM/gtag snippets that might fire before consent.
Known limitations
ShieldConsent provides comprehensive cookie consent management, but like all consent management platforms, it operates within the constraints of browser security, server architecture, and third-party services. Understanding these boundaries helps you configure your site correctly.
Third-party domain cookies
When a third-party script (e.g., Facebook Pixel) sets a cookie on its own domain (.facebook.com), neither JavaScript nor PHP on your domain can delete it. This is a fundamental browser security restriction. ShieldConsent blocks the scripts that create these cookies, preventing them from being set. However, if a third-party cookie was set during a previous visit (before the plugin was installed or before the visitor refused consent), it persists until the browser clears it or the cookie expires.
Page caching & CDN compatibility
ShieldConsent filters scripts at the PHP level via output buffering. This works well with most caching plugins because the filtered HTML is what gets cached. However, certain edge cases require attention:
- Full-page edge caches (Cloudflare APO, Varnish, some hosting-level caches) may serve static HTML without executing PHP at all. In this case, purge the cache after installing ShieldConsent so the filtered version is cached.
- JS minification/concatenation — If an optimization plugin (WP Rocket, Autoptimize, LiteSpeed Cache) combines tracking scripts with other scripts into a single hashed file, ShieldConsent may not recognize the resulting filename. Exclude tracking scripts from JS concatenation, or add the combined file to Managed Endpoints.
- Geolocation + caching — When geolocation is enabled, ShieldConsent automatically signals caching plugins to bypass full-page caching. A runtime geo-fix script corrects the consent mode if a stale cached page is served.
Google Tag Manager as a container
ShieldConsent blocks or unblocks the GTM container script based on consent, and sends Google Consent Mode v2 signals that well-configured tags respect. However, ShieldConsent has no visibility into what tags are configured inside GTM. If a marketing team adds a new tag in GTM without configuring it to check Consent Mode, that tag will fire once the container is loaded — regardless of the visitor's preferences.
Recommendation: Ensure all tags in your GTM container are configured to respect Consent Mode signals. This is a GTM-side configuration step, not a ShieldConsent setting.
Setting up Google tags correctly
header.php or an "Insert Headers and Footers" plugin). Inline scripts like gtag('config', 'G-...') or gtag('config', 'AW-...') bypass ShieldConsent entirely — they set cookies before consent, which violates GDPR.
Option 1 — Via GTM (recommended): Enter your GTM container ID in ShieldConsent settings. Add your GA4 property and Google Ads conversion tag inside GTM with an "All Pages" trigger. ShieldConsent loads the GTM container only when analytics consent is granted and sends Consent Mode v2 signals, so marketing tags inside GTM are gated automatically.
Option 2 — Without GTM: Enter your GA4 Measurement ID (G-XXXXXXX) in ShieldConsent → Protection. ShieldConsent will inject and block the gtag.js script until consent. For Google Ads, add the Ads script URL pattern (e.g., gtag/js?id=aw-) to your Managed Endpoints so ShieldConsent blocks it until marketing consent.
localStorage, sessionStorage, IndexedDB
The Cookie Cleaner targets HTTP cookies only. Some modern analytics and marketing platforms also store identifiers in browser storage APIs (localStorage, sessionStorage, IndexedDB). ShieldConsent prevents these scripts from running when consent is not given (which prevents storage writes), but data written during a previous session with consent is not automatically cleared upon revocation.
Consent proof and network failures
The visitor's consent choice is always saved in a client-side cookie, so the visitor is protected regardless of server response. If the AJAX request to save the consent log fails (due to a 502 error, timeout, or network issue), the server-side audit trail may be incomplete for that specific visitor. The cookie serves as proof of consent, but the detailed log entry (with timestamp, policy version, and category breakdown) may be missing. On shared hosting with strict timeout limits, oversized request headers from many cookies can occasionally trigger this.
Troubleshooting
The banner doesn't appear
- Is the plugin activated?
- Is the consent mode set to "hidden" for your region (geolocation)?
- Is there already a valid consent cookie? Clear cookies or use incognito.
- Is a caching plugin serving a stale page? Purge your cache.
- Check Settings → Diagnostics for competing plugins.
Scripts still load before consent
- A caching plugin cached the page before ShieldConsent was activated — purge the cache.
- A competing plugin (Site Kit, MonsterInsights) injects tracking independently — run Diagnostics.
- The script is not in the known registry — add it manually in Settings → Managed Endpoints.
Google Analytics shows no data
This is expected if visitors haven't consented to analytics yet. GA4 data resumes once visitors accept. With Consent Mode v2, GA4 uses cookieless modeling to estimate data for non-consenting users.
Page reloads in a loop (Firefox private browsing)
Firefox private browsing sends the GPC signal by default. If "Auto reload on consent" is enabled AND GPC enforcement is active, this can cause a loop. Fix: disable "Auto reload on consent" in Settings.
Banner appears in the wrong language
ShieldConsent automatically detects the visitor's language via the Accept-Language header sent by the browser. If your banner shows in an unexpected language (Chinese, Arabic, etc.), the issue is almost certainly in your browser's language settings — not the plugin.
- Chrome: go to Settings → Languages and remove any language you don't use.
- macOS: also check System Settings → General → Language & Region → Preferred Languages.
Each browser manages its own language list, independently from the operating system. Note that extensions are disabled in private/incognito mode, which may explain different behavior between normal and private browsing. After correcting your settings, clear your browser cache and reload the page.
Accept-Language header your browser sends by visiting a site like httpbin.org/headers. The first language in the list is the one ShieldConsent uses.