Google Consent Mode v2 for WordPress: Setup Guide with GTM4WP and CMP Plugins
Set up Google Consent Mode v2 on WordPress the right way. Step-by-step guide using the GTM4WP plugin, Complianz, CookieYes and Cookiebot, with testing instructions.
Running WordPress and seeing EU traffic disappear from your Google Ads and GA4 reports? You probably need Google Consent Mode v2. The good news: on WordPress you can set it up entirely with plugins — no custom code required. This guide shows two reliable ways to do it and how to verify the result.
What WordPress sites need for Consent Mode v2
Consent Mode v2 requires four signals to reach Google before any tag fires: adstorage, analyticsstorage, aduserdata, and adpersonalization. On WordPress, the most common failure is that the cookie banner loads after GA4 or Google Ads tags, so tags fire before consent exists and Google drops the data.
The fix has three parts:
A consent banner (CMP) that supports Consent Mode v2
A default consent state of denied that loads in the <head> before any Google tag
A consent update sent when the visitor accepts or rejects
Method 1: CMP plugin with built-in Consent Mode support (easiest)
Several WordPress consent plugins integrate Consent Mode v2 natively. This is the fastest route for most sites.
Complianz
1. Install the Complianz GDPR/CCPA plugin and run the setup wizard.
2. In Complianz > Settings > General, enable Google Consent Mode v2.
3. Complianz automatically outputs the default consent command in the page head and pushes updates on visitor choice.
4. If you load GA4 through Complianz's own statistics module, consent checks are handled for you. If you load GA4 through GTM, see the GTM notes below.
CookieYes
1. Install the CookieYes plugin and connect your site.
2. In the CookieYes dashboard, enable Google Consent Mode (v2) under Advanced Settings.
3. CookieYes injects the default denied state and supports GTM consent checks via its GTM template.
Cookiebot
1. Install the official Cookiebot plugin.
2. Enable the Google Consent Mode option in the plugin settings, or use the Cookiebot GTM template which ships with default consent built in.
Whichever CMP you choose, the critical check is the same: view your page source and confirm a gtag consent default call (or the CMP's equivalent dataLayer push) appears before your GA4 or Google Ads scripts.
Method 2: GTM4WP + GTM consent configuration (most control)
If you run your tags through Google Tag Manager, the GTM4WP plugin (Google Tag Manager for WordPress) is the cleanest setup.
Step 1: Install GTM4WP
1. Install Google Tag Manager for WordPress by Thomas Geiger.
2. Enter your GTM container ID and choose the recommended codeless injection placement.
3. Save and confirm the GTM snippet loads on every page (view source, search for your GTM-XXXX ID).
Step 2: Install your CMP's GTM template
In GTM, go to Templates > Search Gallery and import your CMP's template (Cookiebot, CookieYes, Complianz, consentmanager and others all publish one). Create a tag from that template and set its trigger to Consent Initialization - All Pages. This guarantees the default denied state fires before every other tag.
Set the default state to:
adstorage: denied
analyticsstorage: denied
aduserdata: denied
adpersonalization: denied
Add urlpassthrough and adsdataredaction if you want extra privacy while consent is denied.
Step 3: Wire consent checks into your tags
1. In GTM, open Admin > Container Settings and enable the Consent Overview.
2. GA4 and Google Ads tags have built-in consent checks — they react automatically once Consent Mode signals exist.
3. For non-Google tags (Meta Pixel, TikTok, LinkedIn), add Additional Consent Checks requiring adstorage so they stay blocked until consent.
Step 4: Test
Open GTM Preview mode on your WordPress site. You should see the consent default state on the Container Loaded event, before any tag fires. Then accept and reject cookies in separate fresh sessions and confirm the update events change tag behavior.
Common WordPress-specific pitfalls
Caching plugins (WP Rocket, W3 Total Cache, LiteSpeed Cache) can serve a cached page where consent scripts load late. Exclude your CMP and GTM scripts from deferred JS or delayed execution features.
Optimization plugins that move scripts to the footer break Consent Mode, because the default state must load in the head first.
Multiple GA4 implementations — for example GA4 loaded by both a theme setting and GTM — cause duplicate pageviews and inconsistent consent behavior. Pick one.
Old Consent Mode v1 code in a child theme's header.php. Search your theme files for gtag('consent' and remove anything that only sets adstorage and analyticsstorage.
How to verify your WordPress setup in 60 seconds
The fastest check is a free scan at tagintegrity.com — it detects your CMP, GTM, GA4, Google Ads and whether all four Consent Mode v2 signals are present. For a deeper manual test, follow the Traffic Light Test in our guide on checking whether Consent Mode v2 is enabled, which shows you how to read the gcs and gcd parameters in network requests and verify behavior in Tag Assistant.
WordPress powers a huge share of sites affected by Consent Mode v2, and the plugin ecosystem makes a correct setup very achievable. Configure the default state, wire your banner to the update event, keep caching plugins from delaying consent scripts — then scan your site to confirm everything is firing correctly.
Run a free Consent Mode v2 scan