> Set up WordPress Consent Mode v2 the right way: Site Kit with the WP Consent API or a banner snippet in the head, cache traps, WooCommerce and tests.
>
> Canonical: https://www.flowconsent.com/en/blog/wordpress-consent-mode-v2-setup

[Platform guides](https://www.flowconsent.com/en/blog?category=platforms)

# WordPress Consent Mode v2: how to set up Google Consent Mode on WordPress

By Roland Vekemans · Published 13 November 2026 · 7 min read

In short

Setting up WordPress Consent Mode v2 comes down to one rule: the four Google consent signals must be set to `denied` before any Google tag runs, then updated when the visitor makes a choice. On WordPress you get there by one of two routes: Site Kit by Google reading consent through the WP Consent API from a compatible consent plugin, or a consent banner snippet at the very top of the `<head>` that drives every tag directly. Most broken setups mix the two routes, or let a cache plugin delay the banner.

## What Consent Mode v2 changes on a WordPress site

Google Consent Mode v2 is how Google tags learn what the visitor accepted. It relies on four signals: `ad_storage`, `analytics_storage`, `ad_user_data` and `ad_personalization`. Since March 2024, Google requires the two newer signals for visitors in the European Economic Area if you want to keep remarketing, audiences and full conversion measurement in Google Ads. Our [Google Consent Mode v2 implementation guide](https://www.flowconsent.com/en/blog/google-consent-mode-v2-implementation-guide) explains the mechanism in detail; this article covers what is specific to WordPress.

Consent Mode does not replace consent. Under the [GDPR](https://www.flowconsent.com/en/laws/gdpr) and the ePrivacy rules, analytics and advertising cookies still need a prior, free choice. Consent Mode only passes that choice to Google tags so they behave accordingly.

On WordPress, the difficulty is not the code. It is the number of places that can load a Google tag:

- Site Kit by Google, which places the GA4 and Google Ads tags when you connect those services;
- an analytics or ecommerce plugin (MonsterInsights, Google Analytics for WooCommerce, a Google Tag Manager plugin);
- code pasted in the theme or in a header plugin such as WPCode;
- a tracking field in a page builder or theme settings.

Each of them can print a `gtag` before or after your banner, and each may follow a different consent source.

## The two ways to set up Google Consent Mode on WordPress

### Route 1: Site Kit and the WP Consent API

The WP Consent API is a free plugin from the WordPress.org directory. It shows no banner. It acts as a shared layer: the consent plugin writes the visitor's choice into it, by category (statistics, marketing, preferences), and other plugins read that state.

Site Kit by Google uses this layer. Its settings include a Consent Mode option that adds the `default` and `update` consent commands to the Google tags Site Kit places. When you switch it on, Site Kit checks whether the WP Consent API is active and offers to install it. Your consent plugin must then write to the WP Consent API: Complianz, iubenda and WebToffee's GDPR Cookie Consent, among others, state that they do. Site Kit itself says it cannot verify compatibility with every plugin, so test the result.

This route suits sites where Site Kit places every Google tag and nothing else loads Google.

### Route 2: a consent banner snippet at the top of the head

The second route places a Consent Mode stub and the consent banner as the first scripts in the `<head>`, through a header plugin such as WPCode or a child theme hooked to `wp_head` with a low priority. The stub declares the four signals as `denied` while the HTML is parsed, before any Google tag. When the visitor clicks, the banner sends `gtag('consent', 'update', …)` and loads, or keeps blocked, the services declared in it.

This route works whatever loads Google (GTM, theme code, a plugin), as long as the stub runs first. It also blocks non-Google scripts such as Meta Pixel or Hotjar, which Consent Mode alone never controls. Its condition: Site Kit must stop placing its own tags, otherwise you have two sources of truth.

## Which route to choose

Pick one consent source per tag, never two.

- **Site Kit places all your Google tags and you only use Google:** route 1 is consistent. Use a consent plugin compatible with the WP Consent API, switch on Consent Mode in Site Kit, and do not add a second gtag.js anywhere else.
- **Your tags live in Google Tag Manager or in theme code, or you also run non-Google pixels:** route 2 is simpler and more complete. Turn off tag placement in Site Kit (it keeps showing your statistics in the dashboard) and let the banner drive Consent Mode. Our [Google Tag Manager and Consent Mode v2 guide](https://www.flowconsent.com/en/blog/google-tag-manager-consent-mode-guide) covers the GTM side.
- **You run both today:** this is the most fragile setup. The banner says "refused" while a Site Kit tag follows a WP Consent API state, or the other way around. Choose one route and remove the duplicate.

Not sure what your site loads before consent? Check it first: run the [free cookie scanner](https://www.flowconsent.com/en/scan) on your home page and on a blog post to see in 30 seconds which cookies are set before any choice.

The choice between Basic and Advanced mode applies to both routes. In Basic mode, Google tags wait for consent; in Advanced mode, they load in cookieless mode and send anonymous pings after a refusal. Our comparison of [Consent Mode basic vs advanced](https://www.flowconsent.com/en/blog/consent-mode-basic-vs-advanced-which-to-choose) explains what each mode does to your data.

## How to set up Consent Mode v2 on WordPress step by step

### With route 1 (Site Kit and WP Consent API)

1. Install a consent plugin that states it is compatible with the WP Consent API, and map its categories (statistics, marketing).
2. In Site Kit, open the settings, find the Consent Mode option and switch it on. Install the WP Consent API when Site Kit offers it.
3. Check that Google Analytics and Google Ads are connected in Site Kit, and remove any other GA4 or Google Ads code from the theme, WPCode or a GTM container.
4. Follow your consent plugin's documentation about its own Consent Mode setting: several advise leaving it off when Site Kit handles Consent Mode, so that only one component sends the `default` command.
5. Clear every cache, then test (see below).

### With route 2 (banner snippet in the head)

1. Copy your banner snippet: the Consent Mode stub first, then the banner loader.
2. Install WPCode, open **Code Snippets → Header & Footer** and paste the snippet at the very top of the **Header** field, above any existing code. Without a plugin, use a child theme and hook the snippet to `wp_head` with priority `1`.
3. If you use GTM, keep its container below the snippet, never above.
4. In Site Kit, turn off **Place Google Analytics code** (and the same option in any other Site Kit module that places a tag), then declare GA4 and Google Ads as services in your banner so they load only after consent.
5. Deactivate any other cookie plugin so visitors see a single banner.

A concrete example: with FlowConsent, the snippet copied from the dashboard already contains the stub with the four `denied` defaults, `wait_for_update`, `url_passthrough` and `ads_data_redaction`, followed by the banner loader. You paste one block and the order is right by construction.

## Cache, optimization and WooCommerce: the WordPress traps

- **"Delay JavaScript" and "defer" options.** WP Rocket, LiteSpeed Cache, Autoptimize or W3 Total Cache can move scripts to the bottom of the page or hold them until the first interaction. If the stub is delayed, Google tags run without defaults. Exclude the stub and the banner domain from these options.
- **Cached pages.** After any change, purge the plugin, host and CDN caches, otherwise visitors keep receiving the old version without the stub.
- **Google Analytics for WooCommerce.** This extension loads its own `gtag` and sets its own Consent Mode defaults. Either remove it and declare GA4 in the banner, or check that its tag lands below the stub and adjust its defaults with the `woocommerce_ga_gtag_consent_modes` filter documented by WooCommerce.
- **Themes and page builders.** A tracking ID typed into a theme or page builder setting prints a tag you may have forgotten. Search your page source for `G-` and `AW-` IDs.

Our [WordPress cookie consent guide](https://www.flowconsent.com/en/blog/wordpress-cookie-consent-gdpr-guide) covers the rest of a WordPress site's compliance, from plugins to the cookie policy.

## How to check that Consent Mode v2 works on WordPress

1. Open the site in a private window and, before clicking anything, look at requests to `google-analytics.com` or `googleadservices.com` in the Network tab. In Advanced mode you may see pings carrying `gcs=G100` (all denied); in Basic mode you should see nothing.
2. Click **Refuse**: no `_ga` or `_gcl_au` cookie should appear.
3. Click **Accept**: the next hits should carry `gcs=G111`.
4. In Google Tag Assistant, the Consent tab should show a `default` state before any tag, then an `update`.
5. Always test logged out: some plugins can exclude logged-in users from tracking, which hides the problem.

Our guide on [how to check that Google Consent Mode v2 is working](https://www.flowconsent.com/en/blog/check-google-consent-mode-v2-working) details each test.

## Common mistakes on WordPress

- Site Kit placing GA4 and a gtag.js in WPCode at the same time: double tracking and two consent sources.
- A consent plugin that does not write to the WP Consent API while Site Kit's Consent Mode is on: Google receives a consent state your visitors never set.
- GTM pasted above the consent snippet: the `config` command reaches Google before the defaults.
- The stub caught by a "delay JavaScript" option: tags fire before the defaults exist.
- Testing only the "Accept" path. The refusal path is the one that has to hold legally.

## How FlowConsent handles Consent Mode v2 on WordPress

FlowConsent follows route 2. You paste one snippet at the top of the WPCode Header field or in a child theme: it sets the four Consent Mode v2 signals to `denied` before any Google tag, then sends the update as soon as the visitor chooses. GA4, Google Ads or Meta Pixel are declared as services and load only after consent, cookies are scanned automatically, and every choice is stored in an exportable consent proof. Installation takes about ten minutes, the banner is hosted in Europe, and the plan is free up to 25,000 sessions per month (Pro at €14.99 per month up to 100,000). The [WordPress installation guide](https://www.flowconsent.com/en/doc/install-wordpress) shows how to turn off Site Kit's tag placement and exclude the snippet from cache plugins.

[Back to the blog](https://www.flowconsent.com/en/blog)

Share this article · [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fwww.flowconsent.com%2Fen%2Fblog%2Fwordpress-consent-mode-v2-setup) · [X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fwww.flowconsent.com%2Fen%2Fblog%2Fwordpress-consent-mode-v2-setup)

Questions

## Common questions on this topic.

Can't find your question? Write to us, we answer fast.

[Write to us](https://www.flowconsent.com/en/demo)

### Does Site Kit support Google Consent Mode v2?

Yes. Site Kit has a Consent Mode setting that adds the default and update consent commands to the Google tags it places. It reads the visitor's choice from the WP Consent API, so you also need a consent plugin that writes to that API. Site Kit offers to install the WP Consent API when you enable the option, and says it cannot verify compatibility with every plugin, so test after setup.

### What is the WP Consent API?

It is a free WordPress plugin that standardizes how consent is stored and read on a site. It shows no banner. A consent plugin writes the visitor's choice into it by category, such as statistics or marketing, and other plugins, including Site Kit, read that state before setting cookies. It only works if both sides support it: the banner that collects consent and the plugin that loads the tracking.

### Do I need Google Tag Manager for Consent Mode v2 on WordPress?

No. Consent Mode works with gtag.js placed by Site Kit, by another plugin or by your theme. Google Tag Manager helps when you manage many tags, but it adds one rule: the consent defaults must be set before the GTM container loads. In practice, the banner snippet with its Consent Mode stub goes above the GTM container in the head, never below it.

### Why does Google still receive requests after a refusal on my WordPress site?

In Advanced mode, Google tags load before the choice and, after a refusal, send cookieless pings marked gcs=G100. No cookie is set and Google uses these pings for modeling. If you see hits marked as granted after a refusal, or \_ga cookies, a tag escapes your banner: often a Site Kit or theme tag placed above the defaults, or a Consent Mode stub delayed by a cache plugin.

### Is Consent Mode v2 enough to make a WordPress site GDPR compliant?

No. Consent Mode only passes the visitor's choice to Google tags. You still need a banner that collects valid consent with a refuse option as easy as accepting, blocks non-Google scripts such as Meta Pixel until consent, keeps a record of each choice and is described in your cookie policy. Consent Mode is one piece of that setup, useful above all for Google Ads and GA4 measurement.

Read next

## Keep reading.

[All articles](https://www.flowconsent.com/en/blog)

[Platform guides · 18 November 2026](https://www.flowconsent.com/en/blog/webflow-consent-mode-v2-setup)

### [Webflow Consent Mode v2: how to set up Google Consent Mode on Webflow](https://www.flowconsent.com/en/blog/webflow-consent-mode-v2-setup)

[Where Google tags come from on Webflow, how to send denied defaults before them, and how to test Consent Mode v2 on the published site.](https://www.flowconsent.com/en/blog/webflow-consent-mode-v2-setup)

[Read the article ](https://www.flowconsent.com/en/blog/webflow-consent-mode-v2-setup)·

[Platform guides · 25 June 2026](https://www.flowconsent.com/en/blog/squarespace-google-consent-mode-v2-setup)

### [Squarespace and Google Consent Mode v2: setup guide](https://www.flowconsent.com/en/blog/squarespace-google-consent-mode-v2-setup)

[Squarespace's built-in banner only covers part of Google Consent Mode v2. This guide explains what it handles, when you need a CMP, and how to set up and verify GA4 and Google Ads tags step by step.](https://www.flowconsent.com/en/blog/squarespace-google-consent-mode-v2-setup)

[Read the article ](https://www.flowconsent.com/en/blog/squarespace-google-consent-mode-v2-setup)·

[Platform guides · 2 November 2026](https://www.flowconsent.com/en/blog/shopify-consent-mode-v2-setup)

### [Shopify Consent Mode v2: how to set it up the right way](https://www.flowconsent.com/en/blog/shopify-consent-mode-v2-setup)

[The two routes that pass consent to Google on Shopify, how to pick one, and how to set up and test Consent Mode v2 without double tracking.](https://www.flowconsent.com/en/blog/shopify-consent-mode-v2-setup)

[Read the article](https://www.flowconsent.com/en/blog/shopify-consent-mode-v2-setup)

## Make your site compliant today.

Free up to 25,000 sessions a month. No credit card, no commitment.

[Create my banner](https://app.flowconsent.com/auth/sign-up?utm_source=flowconsent.com\&utm_medium=referral\&utm_campaign=general) · [Scan my site](https://www.flowconsent.com/en/scan)
