WordPress maintenance or security needs? Reach out!
TLDWP

Plugin: wp-consent-api (Used by 53,023 domains)

WP Consent API

WP Consent API is a plugin that standardizes the communication of accepted consent categories between plugins. It requires a cookie banner plugin and, at least, one other plugin that supports the WP Consent API.

With this plugin, all supporting plugins can use the same set of methods to read and register the current consent category, allowing consent management plugins and other plugins to work together, improving compliance with privacy laws.

WARNING: the plugin itself will not handle consent. It will show you how many plugins you have without Consent API support and will improve compliance on your site by ensuring smooth communication between cookie banner plugins and plugins that set cookies or track user data.

What problem does this plugin solve?

Currently, it is possible for a consent management plugin to block third-party services like Facebook, Google Maps, Twitter, etc. But if a WordPress plugin places a PHP cookie, a consent management plugin cannot prevent this.

Secondly, some plugins integrate the tracking code on the clientside in javascript files that, when blocked, break the site.

Or, if such a plugin’s javascript is minified, causing the URL to be unrecognizable and won’t get detected by an automatic blocking script.

Lastly, the blocking approach requires a list of all types of URL’s that tracks data. A generic API where plugins adhere to can greatly
facilitate a webmaster in getting a site compliant.

Does usage of this API prevent third-party services from tracking user data?

Primary this API is aimed at compliant first-party cookies or tracking by WordPress plugins. If such a plugin triggers, for example, Facebook,
usage of this API will be of help. If a user embeds a Facebook iframe, a blocking tool is needed that initially disables the iframe and or scripts.

Third-party scripts have to blocked by blocking functionality in a consent management plugin. To do this in core would be to intrusive, and is also not applicable to all users: only users with visitors from opt-in regions such as the European Union require such a feature. Such a feature also has a risk of breaking things. Additionally, blocking these and showing a nice placeholder requires even more sophisticated code, all of which should in my opinion not be part of WordPress core, for the same reasons.

How does it work?

There are two indicators that together tell if consent is given for a specific consent category, e.g., “marketing”:
1) the region based consent_type, which
can be opt-in, opt-out, or other possible consent_types;
2) and the visitor’s choice: not set, allow, or deny.

The consent_type is a function that wraps a filter, “wp_get_consent_type”. If there’s no consent management plugin to set it, it will return false. This will cause all consent categories to return true, allowing cookies to be set on all categories.

If opt-in is set using this filter, a category will only return true if the value of the visitor’s choice is “allow”.

If the region based consent_type is opt-out, it will return true if the visitor’s choice is not set or is “allow”.

Clientside, a consent management plugin can dynamically manipulate the consent type and set several cookie categories.

A plugin can use a hook to listen for changes or check the value of a given category.

Categories and most other stuff can be extended with a filter.

Existing integrations

Categorized, and sorted alphabetically

Example plugin

  • Example plugin. The plugin basically consists of a shortcode, with a div that shows a tracking or not tracking message. No actual tracking is done 🙂

Consent Management Providers

Consent Requiring Plugins

Demo site

wpconsentapi.org
Below are the plugins used to set up the demo site:

javascript, consent management plugin

//set consent type
window.wp_consent_type = 'optin'

//dispatch event when consent type is defined. This is useful if the region is detected server side, so the consent type is defined later during the pageload
let event = new CustomEvent('wp_consent_type_defined');
document.dispatchEvent( event );


//consent management plugin sets cookie when consent category value changes
wp_set_consent('marketing', 'allow');

javascript, tracking plugin

//listen to consent change event
document.addEventListener("wp_listen_for_consent_change", function (e) {
  var changedConsentCategory = e.detail;
  for (var key in changedConsentCategory) {
    if (changedConsentCategory.hasOwnProperty(key)) {
      if (key === 'marketing' && changedConsentCategory[key] === 'allow') {
        console.log("just given consent, track user")
      }
    }
  }
});

//basic implementation of consent check:
if (wp_has_consent('marketing')){
  activateMarketing();
  console.log("set marketing stuff now!");
} else {
  console.log("No marketing stuff please!");
}

PHP

//declare compliance with consent level API
$plugin = plugin_basename( __FILE__ );
add_filter( "wp_consent_api_registered_{$plugin}", '__return_true' );

/**
* Example how a plugin can register cookies with the consent API
 * These cookies can then be shown on the front-end, to the user, with wp_get_cookie_info()
 */

function my_wordpress_register_cookies(){
    if ( function_exists( 'wp_add_cookie_info' ) ) {
        wp_add_cookie_info( 'AMP_token', 'AMP', 'marketing', __( 'Session' ), __( 'Store a unique User ID.' ) );
    }
}
add_action('plugins_loaded', 'my_wordpress_register_cookies');


if (wp_has_consent('marketing')){
//do marketing stuff
}

Service-level consent

In addition to category-based consent, the API supports service-level consent control. This allows consent management plugins to grant or deny consent for specific services (like ‘google-analytics’ or ‘facebook-pixel’) independently from their category. When checking service consent with wp_has_service_consent(), the API first checks if explicit consent exists for that service. If no explicit consent is set, it falls back to the consent status of the service’s category. This enables fine-grained control: a user might accept statistics cookies in general, but explicitly deny a specific analytics service.

Service consent can be checked and set both server-side (PHP) and client-side (JavaScript):

PHP:

//check if a specific service has consent
if ( wp_has_service_consent( 'google-analytics' ) ) {
    //activate google analytics
}

//check if a service is explicitly denied
if ( wp_is_service_denied( 'facebook-pixel' ) ) {
    //service was explicitly denied by user
}

//set service consent
wp_set_service_consent( 'google-analytics', true ); //grant consent
wp_set_service_consent( 'facebook-pixel', false ); //deny consent

//listen for service consent changes
add_action( 'wp_consent_service_changed', function( $service, $consented ) {
    error_log( "Service {$service} consent changed to: " . ( $consented ? 'granted' : 'denied' ) );
}, 10, 2 );

JavaScript:

//check service consent
if ( wp_has_service_consent( 'youtube' ) ) {
    //activate tracking
}

//check if explicitly denied
if ( wp_is_service_denied( 'facebook-pixel' ) ) {
    //service denied
}

//set service consent
wp_set_service_consent( 'youtube', true );

//listen for service consent changes
document.addEventListener( 'wp_consent_api_status_change_service', function( e ) {
    console.log( 'Service: ' + e.detail.service + ', consented: ' + e.detail.value );
});

Any code suggestions? We’re on GitHub as well!

DomainExposuresHeadersLast Checked
m*l*n*f*t.cz (WP 6.9.6) F Aug 8, 2026
g*o*a*i*n*r*i*i*a*i*n*.it (WP 7.0.3) B Aug 8, 2026
p*o*i*t*n.c*m.ua (WP 7.0.3) F Aug 8, 2026
p*n*c*o*s*i*.c*m.br F Aug 8, 2026
g*l*z*o.gr F Aug 8, 2026
b*b*o*n*k.cz F Aug 8, 2026
m*t*r*r*i*e*v*r*u*r*j*n*s*a.nl (WP 7.0.3) F Aug 8, 2026
j*m*p*o*e*t*.at (WP 7.0.3) F Aug 8, 2026
o*n*d*a*.c*m.au F Aug 8, 2026
f*c*.org C Aug 8, 2026
e*c*l*o*a*u*o.c*m.br (WP 7.0.2) F Aug 8, 2026
n*t*i*e*.cloud F Aug 8, 2026
t*r*v*r*a*t*c*m*a*y.com F Aug 8, 2026
p*a*i*-*e*g*r.de (WP 7.0.3) F Aug 8, 2026
o*g*l*w*n*o*s*a*i*t*t*k.pl F Aug 8, 2026
k*e*m*v*n*.c*m.au (WP 7.0.3) F Aug 8, 2026
n*t*o*k*e*a*r*.ca (WP 7.0.3) D Aug 8, 2026
l*o*c*p*t*l*.net C Aug 8, 2026
s*a*t*s*t*l*e.dk F Aug 8, 2026
d*i*e*h*n*b*o*s.c*.uk (WP 7.0.3) B Aug 8, 2026
m*x*t*t*u.c*m.br F Aug 8, 2026
v*d*r*o*i*a*.rs (WP 7.0.3) F Aug 8, 2026
v*m.be F Aug 8, 2026
r*v*.pl F Aug 8, 2026
m*d*c*l*e*.c*m.br D Aug 8, 2026
w*l*-*i*.nl (WP 7.0.3) F Aug 8, 2026
c*o*n*t.de (WP 7.0.3) F Aug 8, 2026
h*l*e*w*n*e*g*e*t*n.de B Aug 8, 2026
p*a*i*g*t*r*a*p.com (WP 7.0.3) F Aug 8, 2026
m*r*e*t*l.pl F Aug 8, 2026
s*a*i*a.c*.uk (WP 6.9.6) D Aug 8, 2026
g*a*i*m*c*o.hu (WP 6.8.7) F Aug 8, 2026
d*e*t*r.no D Aug 8, 2026
d*v*o*s*r*a*.nl (WP 7.0.3) F Aug 8, 2026
b*o*k.shop (WP 7.0.3) F Aug 8, 2026
p*n*v*m*s*e*.hu F Aug 8, 2026
p*z*c*y*a*e.net (WP 7.0.3) F Aug 8, 2026
l*n*h*n*e*-*t*e.de F Aug 8, 2026
h*i*e*a*g*r.de (WP 6.9.6) F Aug 8, 2026
x*e.cz F Aug 8, 2026
r*g*r*e*a*t*.c*.uk (WP 6.9.6) F Aug 8, 2026
j*k*a*i*-*h*i*a*s*g*.de (WP 7.0.3) F Aug 8, 2026
l*b*e*.pl (WP 7.0.3) F Aug 8, 2026
s*r*p.com F Aug 8, 2026
l*g*c*m*i*e*r*.c*m.br (WP 7.0.2) F Aug 8, 2026
o*t*o*o*g.nl (WP 6.9.4) F Aug 8, 2026
m*o*k*.pl (WP 7.0.3) F Aug 8, 2026
a*v*s*e*i*l*s*.nl (WP 7.0.3) D Aug 8, 2026
f*n*a*i*n*a*u*l*.o*g.ar (WP 6.8.7) F Aug 8, 2026
l*s*-*i*e*t*r*.com D Aug 8, 2026
m*n*c*m*o*e*i*s.c*m.br F Aug 8, 2026
b*c*o*t*a*k*c.com C Aug 8, 2026
t*i*n.se (WP 7.0.3) F Aug 8, 2026
t*s*t*t*t*k*r*t.hu F Aug 8, 2026
h*o*t*s*s*o*e.com F Aug 8, 2026
w*d*g*o*.com (WP 7.0.3) F Aug 8, 2026
c*e*h*p*e*s.cz (WP 7.0.2) C Aug 8, 2026
p*e*i*e*m*r*e*l*e.com F Aug 8, 2026
s*m*e*d*e*m*.c*m.br (WP 7.0.2) F Aug 8, 2026
s*a*i*g*u*c*u*c*l*.c*.uk F Aug 8, 2026
h*a*l*m.live (WP 7.0.3) B Aug 8, 2026
c*a*i*r*7.fr (WP 7.0.3) F Aug 8, 2026
i*o*a*u*g*.pl (WP 7.0.2) F Aug 8, 2026
c*a*-*o*a*d*u*a.org (WP 7.0.3) F Aug 8, 2026
r*d*o*o*i*-*t*l*n*e*.de F Aug 8, 2026
b*n*a*s*p*r*.com (WP 6.7.5) F Aug 8, 2026
h*c*z*i*s*e*o*p*a*.com (WP 7.0.2) F Aug 8, 2026
d*v*r*l*n*v*.eu F Aug 8, 2026
u*h*t*a.c*.za F Aug 8, 2026
o*d*n.pl (WP 7.0.3) F Aug 8, 2026
m*n*-*a*a*i*e.de (WP 7.0.3) D Aug 8, 2026
p*o*o*i*-*n*i*h*.nl (WP 6.9.5) D Aug 8, 2026
b*a*a*k*c*a.pl (WP 7.0.3) F Aug 8, 2026
p*y*a*n*-*o*y*o*i*k*.pl (WP 7.0.3) F Aug 8, 2026
m*j*o*.c*.uk F Aug 8, 2026
b*u*l*e*-*o*m*n*c*t*o*.fr F Aug 8, 2026
s*i*s*l*r.de F Aug 8, 2026
j*d*.o*.jp F Aug 8, 2026
l*k*a*i*a.cz (WP 6.9.6) F Aug 8, 2026
c*l*s*r*p*e*.com D Aug 8, 2026
a*s*.technology F Aug 8, 2026
e*l*n.org (WP 7.0.3) F Aug 8, 2026
m*l*t*d*s*r*f*.no (WP 7.0.3) F Aug 8, 2026
t*n*k*n*y.com (WP 7.0.3) F Aug 8, 2026
s*i*s*a*c*.c*.uk F Aug 8, 2026
t*i*o*t*e*p*r.nl (WP 7.0.3) F Aug 8, 2026
c*m*c*a*n*e*a*d.it (WP 6.3.2) F Aug 8, 2026
r*b*t*u*y*r*-*e*e*i*e*.hu (WP 7.0.3) F Aug 8, 2026
b*z*n*f*g*o*y*o*t.hu (WP 7.0.3) F Aug 8, 2026
g*a*i*a*.hu (WP 7.0.3) F Aug 8, 2026
c*i*s*o*e*t*m.gr (WP 7.0.3) F Aug 8, 2026
m*d*a*o*f*g*e*o.hu (WP 7.0.3) D Aug 8, 2026
k*e*j*t*i*p*o*u*t*n.nl (WP 7.0.3) F Aug 8, 2026
k*n*e*s*h*i*k*n*g*l*.de (WP 7.0.3) F Aug 8, 2026
h*n*e*r*i*i*g*l*s*.de (WP 7.0.3) F Aug 8, 2026
v*c*o*m*n*.online F Aug 8, 2026
f*h*r*d*s*u*t*e.at F Aug 8, 2026
c*r*n*o*u*e.it (WP 7.0.3) F Aug 8, 2026
c*m*r*c*p*s.com (WP 7.0.3) D Aug 8, 2026
k*d*y*i*.hu (WP 7.0.3) F Aug 8, 2026

Top 50 Plugins

Plugin Count
elementor 1,769,346
contact-form-7 1,749,106
elementor-pro 1,052,340
woocommerce 816,250
revslider 607,543
jetpack 453,908
js_composer 418,849
wp-rocket 341,574
essential-addons-for-elementor-lite 264,357
gravityforms 256,771
complianz-gdpr 256,371
google-site-kit 233,134
cookie-law-info 227,679
instagram-feed 224,217
sitepress-multilingual-cms 210,441
header-footer-elementor 206,342
google-analytics-for-wordpress 204,912
bluehost-wordpress-plugin 192,398
elementskit-lite 179,870
gutenberg 167,419
cookie-notice 148,219
litespeed-cache 145,244
gtranslate 124,626
wpforms-lite 123,431
the-events-calendar 121,906
astra-sites 112,931
popup-maker 109,404
woocommerce-payments 109,075
gutenberg-core 103,091
tablepress 102,235
honeypot 97,691
astra-addon 93,645
wp-smushit 90,636
duracelltomi-google-tag-manager 90,349
layerslider 88,900
all-in-one-seo-pack 88,853
coblocks 86,682
bb-plugin 86,680
akismet 84,800
premium-addons-for-elementor 84,166
ml-slider 82,319
cleantalk-spam-protect 82,314
mailchimp-for-wp 81,479
megamenu 80,103
woocommerce-gateway-stripe 79,241
jet-engine 78,085
ewww-image-optimizer 76,831
fusion-builder 76,801
wp-pagenavi 76,409
smart-slider-3 75,971

Top 50 Themes

Theme Count
hello-elementor 620,531
Divi 494,298
astra 413,258
flatsome 140,195
Avada 120,626
generatepress 114,716
oceanwp 80,206
kadence 78,272
pub 72,255
enfold 68,478
salient 64,947
twentyseventeen 54,217
bb-theme 53,296
twentytwentyfour 52,414
betheme 52,371
blocksy 50,789
cocoon-master 49,250
dt-the7 45,328
twentytwentyfive 45,102
woodmart 43,888
neve 37,982
Avada-Child-Theme 36,857
gox 36,344
h4 36,035
bridge 31,186
twentytwentyone 30,175
lightning 30,043
twentytwenty 28,710
swell 28,104
bricks 26,517
Impreza 25,993
Newspaper 24,245
twentytwentythree 22,054
epik-redesign 19,110
twentytwentytwo 18,763
uncode 18,435
pro 17,618
twentysixteen 17,558
storefront 16,291
sydney 16,177
Total 14,324
hello-theme-child-master 14,051
factory-templates-4 13,735
themify-ultra 12,927
extendable 12,669
hestia 12,521
yootheme 12,445
yith-wonder 12,080
porto 11,952
twentyfifteen 11,851