- SureCookie Installation Guide
- Installing SureCookie Pro
- Updating SureCookie
- How to Set Up SureCookie: Onboarding Wizard Guide
- SureCookie Dashboard Overview
- Connecting Your Site to SureCookie (Scanner Setup)
- Using SureCookie on Multiple Sites
- Uninstalling SureCookie & Data Cleanup
- SureCookie Shortcodes Reference
- Preferences Settings (Menu, Branding, Analytics)
- Customizing Banner Content
- Customizing Banner Layout
- Custom CSS for Banner Styling
- How to Configure the Floating Widget
- Customizing the Preference Modal
- Controlling Where the Cookie Banner Appears
- Customizing Banner Colors (Custom Colors, WCAG)
- Customizing the Blocked Content UI
- Banner Text in the Wrong Language (WPML, Polylang, and Locales)
- Re-Consent
- Understanding SureCookie Logs
- How to Set Up Geographic Targeting
- Block Scripts Until Consent (Resource Blocking)
- Setting Up Google Consent Mode v2
- Consent Models Explained (Opt-in vs Opt-out)
- Exporting Consent Logs (PDF Proof + CSV)
- Consent & Data Settings (Duration, Retention, Renew)
- Consent Forwarding Across a Multisite Network
- Resource / Script Blocking (Add Embeds + Fixes)
- Troubleshooting SureCookie
- Fix a Stuck or Failed Cookie Scan
- Why Some Cookies Aren’t Detected
- Banner Not Appearing: Troubleshooting
- Settings or Cookie Categories Not Saving or Loading
- Embeds Blocked After Consent (YouTube, Maps, Vimeo)
- Site Performance / Page Speed
- Scanning Your Site From Your Browser
- Importing and Exporting SureCookie Settings
- Verifying Your Domain With a DNS Record
WP Consent API Compatibility
Your consent banner is not the only plugin on your site that cares about consent. Statistics, marketing and e-commerce plugins each need to know whether a visitor agreed to tracking. Without a shared standard, each one has to guess. The WP Consent API is the WordPress standard that fixes this: one plugin manages consent, and every plugin that supports the standard reads it.
When the WP Consent API plugin is active, SureCookie registers itself as your site’s consent manager and shares each visitor’s choices with it. Plugins that support the standard then follow your SureCookie banner. Supporting plugins need no extra setup, and they get each new choice as soon as the visitor makes it. This integration is part of the free plugin.
Set Up the Integration
There is no setting for this integration inside SureCookie. It turns on by itself when the WP Consent API plugin is active.
- Install and activate the WP Consent API plugin from the WordPress.org plugin directory.
- Go to SureCookie → Settings → Banner → Content.
- Check that Enable Cookie Banner is on.
The other plugins on your site benefit only if they support the WP Consent API too. Check each plugin’s documentation to confirm.
Note: Use SureCookie 1.5.0 or later. In earlier versions, plugins that read consent on the server were told nothing until a visitor clicked the banner.
How Categories Map
The WP Consent API uses its own names for consent types. SureCookie translates your categories automatically.
| SureCookie Category | WP Consent API Type |
|---|---|
| Essential Cookies | functional |
| Functional Cookies | preferences |
| Analytics Cookies | statistics |
| Marketing Cookies | marketing |
| Uncategorized Cookies | marketing |
| Custom categories you add | marketing |
SureCookie shares four of the API’s types: functional, preferences, statistics and marketing. By default, it does not set the API’s statistics-anonymous type (see For Developers below).
Two details are worth knowing:
- Essential Is Always Allowed – Strictly necessary cookies do not need consent, so the
functionaltype always reads as allowed, whatever the visitor chose. - Marketing Cookies Decides the Marketing Type – The API holds one answer per type. Uncategorized and custom categories share the
marketingtype with Marketing Cookies, and the visitor’s Marketing Cookies choice decides it. A visitor who accepts Marketing Cookies but declines one of your custom categories still reads as allowed formarketing.
To add or review your own categories, see Manage Cookie Categories.
For Developers
The surecookie_wp_consent_api_category_map filter changes the type for custom and Uncategorized categories only. The four built-in categories always keep the mapping above. Pointing a custom category at a type a built-in category already uses has no effect, because the built-in category’s choice decides that type. Only statistics-anonymous, which no built-in category uses, gives a custom category a signal of its own. See Developer Reference: Hooks & Filters.
What the API Reports Before a Choice
Until a visitor responds to the banner, SureCookie reports the consent model that applies to them:
- Opt-in –
functionalreads as allowed.preferences,statisticsandmarketingread as denied. - Opt-out – Every type reads as allowed until the visitor declines.
Out of the box, SureCookie uses opt-in for every visitor.
With Geographic Rules
Geographic Rules is a SureCookie Pro feature, set under SureCookie → Tracking Manager → Geographic Rules. When you choose Show only where required by law, visitors in a targeted region get that region’s consent model in the API. To set up regions, see How to Set Up Geographic Targeting.
How It Works
SureCookie shares consent in the two places other plugins look for it:
- In the browser – Each choice goes to the API as the visitor makes it, and again on every page load. Scripts that listen for consent changes can react without a reload.
- On the server – Once WordPress has finished loading, SureCookie reads the visitor’s stored choice and answers consent checks from other plugins in that same request, such as a call to
wp_has_consent()while the page is built. A check made earlier, duringplugins_loadedorinit, does not get SureCookie’s answer yet. If a full-page cache serves the page, that answer is cached with it, so a plugin that needs each visitor’s own answer should read consent in the browser. See Compatibility: Caching Plugins & Page Builders.
What It Does Not Replace
The WP Consent API is a communication standard, not an enforcement tool. A plugin that ignores the standard still sets its cookies. SureCookie’s Block Scripts Until Consent handles those: it holds scripts and embeds on the page until the visitor consents, whether or not they support the API.
Use both together. The API covers plugins that cooperate, and blocking covers everything else.
Troubleshooting
- A plugin still sets cookies before consent – It probably does not support the WP Consent API. Block it instead under SureCookie → Tracking Manager → Scripts and Embeds.
- You are not sure the integration is active – It runs only while the WP Consent API plugin is active. Check Plugins → Installed Plugins, then confirm Enable Cookie Banner is on.
- A supporting plugin stays off before visitors choose – This is the opt-in default. The API reports consent once the visitor accepts the matching category.
- A plugin runs after a visitor declined a custom category – Custom categories share the
marketingtype, so the visitor’s Marketing Cookies choice decides it. See How Categories Map above.
Next Steps
To hold back plugins that do not support the standard, see Resource / Script Blocking (Add Embeds + Fixes). To understand the defaults the API reports, see Consent Models Explained (Opt-in vs Opt-out).
We don't respond to the article feedback, we use it to improve our support content.