WordPress maintenance or security needs? Reach out!
TLDWP

Plugin: wp-consent-api (Used by 53,105 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
a*q*e.eu F Aug 8, 2026
c*s*o*e*.es F Aug 8, 2026
v*s*z.sk F Aug 8, 2026
b*k*-*e*m.pl (WP 6.7.6) F Aug 8, 2026
o*e*t*p*o*w*r*.pl F Aug 8, 2026
c*u*f*i*n*s.lv F Aug 8, 2026
b*a*n*l*.pl F Aug 8, 2026
s*a*d*r*i*o.de (WP 7.0.2) F Aug 8, 2026
t*i*o*p*o*s*r*i*e*a.com F Aug 8, 2026
x*s*l*b.c*m.br F Aug 8, 2026
d*v*d*o*d*.net F Aug 8, 2026
y*g*d*e*m*.nl F Aug 8, 2026
k*n*r*l*b*t*v.sk F Aug 8, 2026
m*n*o*o*e.c*m.br F Aug 8, 2026
m*n*s*n*a*a*a.com (WP 7.0.3) F Aug 8, 2026
r*g*o*n*.c*m.ar (WP 7.0.2) F Aug 8, 2026
p*r*g*n*k*y*.lk F Aug 8, 2026
p*r*g*n*k*.com F Aug 8, 2026
c*r*y*i*a*y*e*e*g*t*c*n*.org F Aug 8, 2026
p*w*e*t*r.org (WP 7.0.3) F Aug 8, 2026
g*e*n*l*g.ir F Aug 8, 2026
g*m*i*d*-*a*h*e.de F Aug 8, 2026
d*a.c*m.pl (WP 7.0.3) F Aug 8, 2026
i*e*4*r*.pl (WP 6.8.1) F Aug 8, 2026
l*k*v*e*m*n*s*r*e*.camp F Aug 8, 2026
l*n*s*h*n*.c*.uk (WP 7.0.3) F Aug 8, 2026
a*s*.de F Aug 8, 2026
m*d*e*h*a*t*.net A Aug 8, 2026
t*e*y*v*t.in (WP 6.8.7) F Aug 8, 2026
z*r*m*d*a.hu F Aug 8, 2026
c*l*r*a*h*m*-*b*a*.nl (WP 7.0.2) F Aug 8, 2026
s*e*i*g*s*o*t*b*.se D Aug 8, 2026
r*h*a*n*s*i*l*.org (WP 7.0.3) F Aug 7, 2026
a*l*t.cz F Aug 7, 2026
e*h*p*e.c*.uk D Aug 7, 2026
t*m*o*e*h.c*m.br (WP 7.0.3) F Aug 7, 2026
b*r*h*l*m*w*a*d*c*p*n*.com F Aug 7, 2026
k*t*o*i*k*h*i*f*o*t.nl F Aug 7, 2026
a*y*t*e*.com F Aug 7, 2026
k*r*a*s*a*e.ro (WP 7.0.3) F Aug 7, 2026
h*-*m*.de (WP 7.0.2) F Aug 7, 2026
s*r*z*k*t*e*a.gr (WP 7.0) F Aug 7, 2026
g*l*x*p*r*.es F Aug 7, 2026
r*b*m*e.c*.uk F Aug 7, 2026
b*e*.cz F Aug 7, 2026
s*h*e*d*.com D Aug 7, 2026
g*a*e*a*k*r*.ca (WP 7.0.3) C Aug 7, 2026
e*p*r*t*a*e*g*o*p.c*m.au (WP 7.0.2) F Aug 7, 2026
k*m*d*a*i*n.de (WP 7.0.2) F Aug 7, 2026
d*w*e*v*n*e*i*w*s*e*i*g.nl F Aug 7, 2026
h*l*e*l*n*k*e*t*o*d*e*m.no F Aug 7, 2026
i*m*n*e*k*r*k*i*p*n.nl (WP 7.0.3) C Aug 7, 2026
t*c*n*c*s.c*m.br (WP 7.0.2) F Aug 7, 2026
b*d*p*r*l*k*s*k.hu F Aug 7, 2026
m*m*r*a*o*i*t*i*n*.c*m.br D Aug 7, 2026
c*o*o*i*.c*m.br (WP 7.0.3) F Aug 7, 2026
r*o*u*t*o*s.c*m.br (WP 7.0.3) F Aug 7, 2026
p*k*i*n.ro (WP 6.9.4) F Aug 7, 2026
m*w*l*a*o*t.net F Aug 7, 2026
m*n*a*a*e*a*c*.com F Aug 7, 2026
p*o*o*w*e*d*n.nl (WP 7.0.3) F Aug 7, 2026
c*s*d*a*d*l*c*a*r*s*a*t*s.es (WP 7.0.3) F Aug 7, 2026
e*o*i.is (WP 6.9.6) F Aug 7, 2026
t*a*i*e.c*.il F Aug 7, 2026
b*u*a*s*r*i*e*.ch F Aug 7, 2026
k*k*a*u*t*u*i*k*.fi (WP 7.0.3) F Aug 7, 2026
f*m*l*e*i*h*u*a*i*u*t*u*s.com F Aug 7, 2026
s*i*l*y*h*s*.o*g.uk F Aug 7, 2026
m*e*d*l*f*l*.org D Aug 7, 2026
h*r*a*h*a*o*a*.fr F Aug 7, 2026
t*i*k*i*t*n.com F Aug 7, 2026
h*u*e*d*e*e*k*p*e*.nl (WP 7.0.3) F Aug 7, 2026
s*e*d*a*c*.c*.hu (WP 7.0.2) F Aug 7, 2026
f*x*y*u*f*o*e.c*.uk (WP 7.0.2) F Aug 7, 2026
k*d*o*k*r*a*k*e.pl F Aug 7, 2026
k*t*e*c*u*f*z*o.sk (WP 7.0.3) F Aug 7, 2026
b*r*-*t*r*.c*.uk (WP 7.0.3) F Aug 7, 2026
a*t*-*c*n.eu (WP 7.0.3) F Aug 7, 2026
g*v*n*n*i*l.com (WP 7.0.3) F Aug 7, 2026
h*r*t*m*r*z*n*r*m.de (WP 7.0.3) F Aug 7, 2026
e*p*n*a*s.c*m.br F Aug 7, 2026
i*v*-*a*t*d*f*a*c*.fr (WP 7.0.3) F Aug 7, 2026
g*a*s*e*n*d*i*s.nl (WP 6.1.10) F Aug 7, 2026
g*a*s*e*n*i*e*t.nl (WP 6.1.10) F Aug 7, 2026
4*d*u*o*a*a*i*e.nl F Aug 7, 2026
a*c*e*v*.si (WP 7.0.3) F Aug 7, 2026
a*c*e*v*.ro (WP 7.0.3) F Aug 7, 2026
a*c*e*v*.c*m.pl (WP 7.0.3) F Aug 7, 2026
a*c*e*v*.hr (WP 7.0.3) F Aug 7, 2026
p*p*a*a.c*m.br (WP 7.0.3) F Aug 7, 2026
g*o*a*f*s*f*x.com (WP 7.0.2) F Aug 7, 2026
t*i*r*z*w*o*l*w*k.pl (WP 7.0.3) F Aug 7, 2026
j*r*s*a*s*b*o*i*k.pl F Aug 7, 2026
h*t*l*e*a*s*.sk (WP 7.0.3) F Aug 7, 2026
s*f*l*.be (WP 6.9) F Aug 7, 2026
t*c*o*i*e.c*.uk (WP 7.0.3) F Aug 7, 2026
l*-*o*n*-*l*c*.fr (WP 7.0.3) F Aug 7, 2026
g*p*e*.pt (WP 7.0.3) F Aug 7, 2026
n*v*s*o*e.it (WP 6.9.6) F Aug 7, 2026
p*o*o*s*l*.as F Aug 7, 2026

Top 50 Plugins

Plugin Count
elementor 1,771,157
contact-form-7 1,751,399
elementor-pro 1,053,488
woocommerce 817,069
revslider 608,229
jetpack 454,248
js_composer 419,287
wp-rocket 342,023
essential-addons-for-elementor-lite 264,638
gravityforms 256,912
complianz-gdpr 256,730
google-site-kit 233,420
cookie-law-info 228,068
instagram-feed 224,430
sitepress-multilingual-cms 210,630
header-footer-elementor 206,557
google-analytics-for-wordpress 205,032
bluehost-wordpress-plugin 192,442
elementskit-lite 180,019
gutenberg 167,546
cookie-notice 148,359
litespeed-cache 145,640
gtranslate 124,682
wpforms-lite 123,492
the-events-calendar 122,085
astra-sites 113,017
popup-maker 109,517
woocommerce-payments 109,122
gutenberg-core 103,285
tablepress 102,382
honeypot 97,777
astra-addon 93,707
wp-smushit 90,717
duracelltomi-google-tag-manager 90,478
layerslider 88,979
all-in-one-seo-pack 88,932
coblocks 86,793
bb-plugin 86,728
akismet 84,816
premium-addons-for-elementor 84,243
ml-slider 82,440
cleantalk-spam-protect 82,367
mailchimp-for-wp 81,520
megamenu 80,206
woocommerce-gateway-stripe 79,290
jet-engine 78,186
ewww-image-optimizer 76,933
fusion-builder 76,875
wp-pagenavi 76,541
smart-slider-3 76,089

Top 50 Themes

Theme Count
hello-elementor 621,297
Divi 494,744
astra 413,658
flatsome 141,036
Avada 120,735
generatepress 114,817
oceanwp 80,274
kadence 78,395
pub 72,376
enfold 68,560
salient 64,968
twentyseventeen 54,280
bb-theme 53,317
twentytwentyfour 52,480
betheme 52,469
blocksy 50,876
cocoon-master 49,298
dt-the7 45,379
twentytwentyfive 45,226
woodmart 43,964
neve 38,015
Avada-Child-Theme 36,885
gox 36,383
h4 36,109
bridge 31,206
twentytwentyone 30,202
lightning 30,073
twentytwenty 28,728
swell 28,154
bricks 26,560
Impreza 26,020
Newspaper 24,294
twentytwentythree 22,068
epik-redesign 19,112
twentytwentytwo 18,786
uncode 18,454
pro 17,622
twentysixteen 17,586
storefront 16,304
sydney 16,203
Total 14,341
hello-theme-child-master 14,069
factory-templates-4 13,749
themify-ultra 12,955
extendable 12,679
hestia 12,541
yootheme 12,456
yith-wonder 12,079
porto 11,968
twentyfifteen 11,863