Works with your stack
Cookie consent that speaks WP Consent API
refreshed on every page
WP Consent API is a free plugin that carries the visitor’s choice from your consent banner to other plugins, such as Site Kit, WooCommerce and WP Statistics. It asks nothing and holds nothing on its own. Cookie Rocks gives it the choice on every page, not only at the click.
WP Consent API
WordPress plugin
- Tested version
- 2.1.0
- How
- Tested automatically at each Cookie Rocks release
- Last test
- 3 November 2026
- Latest version
- 2.1.0 tested
- Active installs
- 300,000+
What WP Consent API puts on your pages
- A small script
- Loaded at the bottom of each page, from your own site. It makes no request to another site and adds no tracker.
- One cookie per category
- Its
wp_consent_cookies hold allow or deny for functional, preferences, statistics, statistics-anonymous and marketing. Only the consent plugin writes them. - A consent type
- Opt-in or opt-out, set by the consent plugin. Other plugins read it to know whether they must wait for the visitor.
What matters for consent with WP Consent API
Alone, it allows everything
If no consent plugin sets the consent type, WP Consent API tells every plugin that consent is given. Installing it without a banner protects nothing.
Refreshed on every page
The API’s cookies expire on their own. A banner that writes them only at the click can let them run out first, and plugins then read a refusal from a visitor who accepted. Cookie Rocks writes the choice again on every page and gives those cookies the same lifetime as its own.
Declared, with the right type
Cookie Rocks registers itself with WP Consent API as a consent plugin. It sets the type to opt-in, or to opt-out when you use information mode where the law allows it.
Plugins with a list of their own
Some plugins trust only the consent plugins named in their own code. WP Statistics is one of them: with any other banner, its consent setting stays greyed out. With WP Consent API active, the complete plugin makes WP Statistics wait for the choice anyway, without changing its settings.
Keep its script whole
WP Consent API’s script relies on a small inline variable printed just before it. A performance plugin that combines or delays it breaks the API. Exclude it from both.
Cookie Rocks with WP Consent API
- Passes the visitor’s choice to WP Consent API on every page, where this plugin reads it.
- Registers with WP Consent API, with cookie lifetimes matched to the visitor’s choice.
What our tests found on WP Consent API
Good to know · Site Kit by GoogleSite Kit restores a saved choice only if the banner declares its consent type
Site Kit reads a saved choice on the next page only when the banner sets wp_consent_type. Cookie Rocks sets it on every page.
Read in its code, 3 November 2026, Site Kit by Google 1.191.0. Source
Full detail
On each page load, Site Kit's consent script reads the visitor's saved choice from WP Consent API only when the banner has declared a consent type (window.wp_consent_type or wp_fallback_consent_type). Without it, Site Kit only reacts to a new choice, and Google consent stays denied on the next pages. Cookie Rocks declares the consent type on every page, so a saved choice is restored. Site Kit support gave other banners the wp_get_consent_type filter as a workaround (October 2026).
Depends on a setting · Pixel Manager for WooCommercePixel Manager for WooCommerce reads consent through WP Consent API
With the WP Consent API plugin, consent started all its pixels without a reload. Without that plugin, only Google and Microsoft UET started; the other pixels stayed off.
Seen in our tests, 18 October 2026, Pixel Manager for WooCommerce 1.70.0.
Full detail
Pixel Manager for WooCommerce reads consent through the WP Consent API (wp_consent_type and the wp_listen_for_consent_change event). With the WP Consent API plugin installed, a consent given on the page started all its pixels without a reload. Without that plugin and with wp_consent_type set to optin, only Google and Microsoft UET started after consent; the other pixels stayed off.
Set before the choice · WP Consent APIWP Consent API cookies are set to deny before any choice
When the banner syncs WP Consent API on each page, the five wp_consent_ cookies are set with deny. They tell other plugins the choice; an auditor sees them before the choice.
Seen in our tests, 16 October 2026, WP Consent API 2.1.0.
Full detail
WP Consent API's cookies wp_consent_functional, wp_consent_preferences, wp_consent_statistics, wp_consent_statistics-anonymous and wp_consent_marketing are set on the site's domain before any choice, with the value deny, when the banner syncs WP Consent API on each page. They tell other plugins the choice; an auditor sees them before the choice.
Good to know · WP Consent APIWith WP Consent API, comment cookies wait for preferences consent
With WP Consent API active, WordPress no longer shows the comment form's "save my name" checkbox, and the comment_author_* cookies are set only when the preferences category is granted.
Read in its code, 16 October 2026, WP Consent API 2.1.0.
Good to know · WP Consent APIWP Consent API stores the choice in one cookie per category
setting “wp_consent_api_cookie_expiration (filter)” · by default: 30 days
- Five wp_consent_ cookies, plus wp_consent_consented_services for single tools.
- Set by JavaScript for 30 days, only when a consent plugin writes the choice.
- Read by PHP from the request, so a page served from cache ignores them.
Read in its code, 16 October 2026, WP Consent API 2.1.0.
Full detail
WP Consent API stores the choice in one first-party cookie per category (wp_consent_functional, wp_consent_preferences, wp_consent_statistics, wp_consent_statistics-anonymous, wp_consent_marketing), set by JavaScript with path=/, Secure on HTTPS and no SameSite, for 30 days unless filters change it, plus wp_consent_consented_services (JSON) for consent to single tools. They are written only when a consent plugin calls wp_set_consent(). Its change event fires only when a value changes. PHP reads come from the request cookies, so a page served from cache ignores them. The service hook in code is wp_consent_api_status_change_service.
Good to know · WP Consent APIWithout a consent plugin, WP Consent API says yes to every category
It asks for nothing and blocks nothing. With optin, consent is true only when the category cookie is allow; with optout, while the cookie does not exist. It contacts no other site.
Read in its code, 16 October 2026, WP Consent API 2.1.0.
Full detail
WP Consent API asks for nothing and blocks nothing. Without a consent plugin that sets the consent type, wp_has_consent() returns true for every category. With optin it is true only when the category cookie is allow; with optout it is true while the cookie does not exist. Categories are functional, preferences, statistics, statistics-anonymous and marketing (no necessary). Its script loads in the footer at priority PHP_INT_MAX - 100 and relies on an inline consent_api variable printed just before it. It makes no request to another site and contains no gtag or Consent Mode code.
Good to know · Site Kit by GoogleSite Kit reads WP Consent API only when its Consent Mode setting is on
setting “Consent Mode” · by default: off
With that setting off, Site Kit sends no consent signal at all, and the visitor's choice reaches Google only through the banner's own signals.
Read in its code, 15 October 2026, Site Kit by Google 1.189.0.
Full detail
Site Kit declares itself compatible with WP Consent API, but its code reads WP Consent API only when its own Consent Mode setting is on. With that setting off, Site Kit pushes no consent command at all, and the visitor's choice reaches Google only through the banner's own Consent Mode signals.
Good to know · WP Consent APICookie Rocks rewrites the WP Consent API cookies on every page
They last 30 days by default, so a banner that writes them only at the click leaves Site Kit with no consent later. In a test, deleted cookies were set again and Google read granted.
Seen in our tests, 8 October 2026, WP Consent API.
Full detail
WP Consent API keeps its wp_consent_* cookies for 30 days by default. A banner that writes them only at the click leaves Site Kit reading no consent after 30 days, while the banner's own choice is still valid. Cookie Rocks writes the visitor's choice to WP Consent API on every page: in a test, the wp_consent_* cookies were deleted and the page reloaded; they were set again to allow, and Site Kit and Google read granted.
How we test it
At every Cookie Rocks release
It runs in the automatic tests of every Cookie Rocks release, next to the banner.
- WP Consent API 2.1.0, tested on 3 November 2026.
Questions
Do I need WP Consent API?
Only if a plugin on your site reads the choice through it, such as Site Kit, WooCommerce or WP Statistics. The free Audit tells you which case you are in: Connected, Missing or Not needed yet.
Does it replace a consent banner?
No. It shows nothing and holds nothing. It only carries the choice made in your banner to the plugins that ask for it.
Which categories does Cookie Rocks send?
The five of the API. Functional follows Necessary, preferences and marketing follow their own categories, statistics follows Statistics. Statistics-anonymous follows audience measurement when your site uses that exemption, and Statistics otherwise.
What changes for comments?
With WP Consent API active, WordPress sets its comment cookies only when the visitor accepts preferences, and the comment form no longer shows its own cookie checkbox.
What happens after the 30-day trial?
The banner, your visitors’ choices and your proofs of consent keep working. Without a key, most settings lock, updates and support stop. Take a key at any time and everything opens again.
For sites using WP Consent API
Every plugin reads the same choice.
refreshed on every page
Every feature of the complete plugin for 30 days, no card. WP Consent API stays installed and keeps its job.
- During the trial: everything, including the full settings and the scans
- After 30 days without a key: the banner, your visitors’ choices and your proofs of consent keep working
- What waits for a key: most settings, updates and support

Get your trial key
Your e-mail and your site. Your key arrives as soon as you confirm your e-mail.