WordPress maintenance or security needs? Reach out!
TLDWP

Plugin: wp-consent-api (Used by 53,002 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*e*c*-*x*r*s*i*n.com F Aug 19, 2026
a*c*n*s.info (WP 7.0.4) F Aug 19, 2026
a*e*c*-*l*o*.com (WP 6.9.7) F Aug 19, 2026
c*m*t*n*w.com (WP 7.0.4) C Aug 19, 2026
l*d*e*l*g*x.com (WP 7.0.4) D Aug 19, 2026
g*l*p*o*e*c*o*d*d*t*s.com (WP 7.0.4) F Aug 19, 2026
k*b*o*l*.com (WP 7.0.4) F Aug 19, 2026
g*l*t*a*e*a*e*e*.com (WP 7.0.4) C Aug 19, 2026
a*e*c*-*b*.com F Aug 19, 2026
p*n*n*u*a*e*r*l*u*1.com F Aug 19, 2026
e*a*e*.no (WP 6.7.7) F Aug 19, 2026
i*d*-*n.com (WP 7.0.2) F Aug 19, 2026
l*m*d*a.cz (WP 6.7.7) F Aug 19, 2026
c*c*a*.ai D Aug 19, 2026
s*h*o*g*n*o*l*n*.de (WP 7.0.4) F Aug 19, 2026
s*y*e*m*.com D Aug 19, 2026
h*r*z*n*o*s*l*.fr (WP 7.0.4) F Aug 19, 2026
e*f*k*.com (WP 7.0.4) D Aug 19, 2026
c*m*n*o*t*p*.com F Aug 19, 2026
p*o*e*s*a*i*n*a*i.com (WP 7.0.4) F Aug 19, 2026
s*u*g*s*e*s*r*i*e*.com F Aug 19, 2026
l*d*r*e*k*t*t*.com A Aug 19, 2026
c*r*i*a*o*o.fr F Aug 19, 2026
m*s*s*i*o*o*c*.com F Aug 19, 2026
s*r*i*a*.com F Aug 19, 2026
p*n*n*u*a*s*l*r.com (WP 7.0) F Aug 19, 2026
a*e*c*-*r*n*m*.com B Aug 19, 2026
a*u*i*.n*t.ua F Aug 19, 2026
b*a*c*u*e*a*s*l*n.nl (WP 7.0.4) F Aug 19, 2026
m*h*a*g*a*l*a*d*a*h*s.nl (WP 7.0.4) F Aug 19, 2026
a*f*h*d*i*l*n*-*b*d*a*i.com F Aug 19, 2026
r*k*b*g*r.id (WP 7.0.4) F Aug 19, 2026
a*e*c*-*l*e*e*t*.com (WP 6.8.8) F Aug 19, 2026
k*w*t*i*o*d*t*r*g*.ca (WP 7.0.4) F Aug 19, 2026
k*w*t*i*o*r*.ca (WP 7.0.4) F Aug 19, 2026
l*d*p*n*a*e*u*o*l*.com (WP 7.0.4) F Aug 19, 2026
k*j*k*2*.eu F Aug 19, 2026
t*e*o*n*r.mx (WP 7.0.4) F Aug 19, 2026
a*n*e*e*s*e*r*j*r*i*n*e*s.nl (WP 7.0.4) F Aug 19, 2026
t*w*.berlin F Aug 19, 2026
c*m*l*g.com (WP 6.7.7) A Aug 19, 2026
c*m*n*j*i*r*a*r*a*i*a.com (WP 6.9.7) F Aug 19, 2026
i*d*x*d.com (WP 7.0.4) F Aug 19, 2026
g*s*o*a*s*i*.com (WP 7.0.4) F Aug 19, 2026
a*e*s*a*e.com F Aug 19, 2026
v*s*a*l*.com B Aug 19, 2026
c*m*d*n*a*d*c*e*.com B Aug 19, 2026
c*m*d*n*a*.com B Aug 19, 2026
b*t*e*i*u*l*t.com F Aug 19, 2026
a*e*a*i*i*.c*.uk (WP 6.9.7) F Aug 19, 2026
a*t*s*u*.fr F Aug 19, 2026
i*d*s*r*c*i*l*s*o*.com F Aug 19, 2026
k*u*e*s*i*t*j*a*n*.fi (WP 7.0.4) F Aug 19, 2026
a*e*a*i*i*.com (WP 6.9.7) F Aug 19, 2026
l*d*a*m*.com (WP 7.0.4) F Aug 19, 2026
l*v*e*-*-*r*s*r*.fr F Aug 19, 2026
c*a*t*r*e*i*n.studio (WP 7.0.4) D Aug 19, 2026
f*e*h*l*n*t.ro (WP 7.0.4) F Aug 19, 2026
l*d*i*y*g*l*.com (WP 7.0.4) F Aug 19, 2026
p*o*o*o*a*i.ro D Aug 19, 2026
p*o*e*y.com (WP 7.0.4) F Aug 19, 2026
i*d*s*t*f*x*s.com (WP 7.0.4) F Aug 19, 2026
a*m*-*a*a*c*s.fr (WP 7.0.4) F Aug 19, 2026
g*l*a.com (WP 7.0.4) F Aug 19, 2026
f*e*h*m*a*.ro (WP 7.0.4) F Aug 19, 2026
i*d*r*e*d*.com (WP 6.7.2) F Aug 19, 2026
s*u*n*n*r*n*v*t*o*s.com (WP 7.0.4) F Aug 19, 2026
s*n*i*r*-*i*i*a*i.info (WP 7.0.4) F Aug 19, 2026
p*n*u*n*w*p.com F Aug 19, 2026
a*e*e*s*a*o*r*.com (WP 7.0.2) B Aug 19, 2026
a*e*e*s*i*i*g*x.com F Aug 19, 2026
a*e*e*s*i*i*g*h.com F Aug 19, 2026
a*e*e*s*i*i*g*o.com F Aug 19, 2026
w*b*i*d*k*a*n*f*n*.org F Aug 19, 2026
s*p*e*e*n*u*t*i*s.com (WP 7.0.4) D Aug 19, 2026
m*r*s*l*s.com (WP 6.9.7) F Aug 19, 2026
s*p*a*i*.com (WP 6.8.8) F Aug 19, 2026
p*c*p*l*t*c*.c*m.br (WP 7.0.4) F Aug 19, 2026
b*b*i*t*p*.de (WP 7.0.4) F Aug 19, 2026
a*i*a*.net (WP 7.0.3) F Aug 19, 2026
c*m*c*a*s*r*f*s.com F Aug 19, 2026
e*c*n*r*l*f.com (WP 7.0.4) F Aug 19, 2026
g*l*o*h*e*s.com F Aug 19, 2026
g*l*o*m*i*a*c*a*.com F Aug 19, 2026
c*m*c*c*a*.com F Aug 19, 2026
a*n*r*.art (WP 7.0.4) F Aug 19, 2026
a*n*r*k*u*i*g.sk F Aug 19, 2026
c*p*c*r*.c*m.pa (WP 7.0.4) F Aug 19, 2026
o*b*a*.fr F Aug 19, 2026
a*k*r*p*o*a.sk F Aug 19, 2026
a*e*a*d*r*t*.com (WP 6.9) F Aug 19, 2026
o*j*t*o*n*c*e.net D Aug 19, 2026
c*m*c*e*e*s*s.com F Aug 19, 2026
p*y*e*i*.it (WP 7.0.4) F Aug 19, 2026
c*e*n*g*e*n.org A Aug 19, 2026
c*r.nl D Aug 19, 2026
u*t*m*t*s*u*c*.tv B Aug 19, 2026
l*c*c*n*a*f*e*.fr (WP 7.0.4) F Aug 19, 2026
c*r*i*i*.com (WP 7.0.4) F Aug 19, 2026
m*u*a*t.com D Aug 19, 2026

Top 50 Plugins

Plugin Count
elementor 1,756,417
contact-form-7 1,739,146
elementor-pro 1,045,139
woocommerce 811,111
revslider 602,338
jetpack 450,979
js_composer 415,073
wp-rocket 338,554
essential-addons-for-elementor-lite 262,060
gravityforms 255,299
complianz-gdpr 254,320
google-site-kit 233,737
cookie-law-info 226,306
instagram-feed 222,562
sitepress-multilingual-cms 208,363
header-footer-elementor 204,194
google-analytics-for-wordpress 202,959
bluehost-wordpress-plugin 191,828
elementskit-lite 177,800
gutenberg 168,162
cookie-notice 146,957
litespeed-cache 145,450
gtranslate 122,877
wpforms-lite 121,752
the-events-calendar 121,269
gutenberg-core 119,314
astra-sites 111,421
popup-maker 108,437
woocommerce-payments 108,236
tablepress 101,798
honeypot 97,544
astra-addon 92,943
coblocks 90,919
wp-smushit 89,791
duracelltomi-google-tag-manager 89,744
layerslider 88,055
all-in-one-seo-pack 88,008
bb-plugin 86,034
akismet 84,170
premium-addons-for-elementor 83,056
ml-slider 82,258
cleantalk-spam-protect 81,512
mailchimp-for-wp 80,558
megamenu 79,660
woocommerce-gateway-stripe 77,832
jet-engine 77,396
ewww-image-optimizer 76,881
wp-pagenavi 76,410
fusion-builder 76,340
smart-slider-3 75,234

Top 50 Themes

Theme Count
hello-elementor 616,575
Divi 490,735
astra 410,032
flatsome 142,460
Avada 119,871
generatepress 114,010
pub 83,155
oceanwp 79,499
kadence 77,966
enfold 67,901
salient 64,434
twentyseventeen 53,951
bb-theme 52,764
twentytwentyfour 52,681
betheme 52,169
blocksy 50,495
cocoon-master 49,392
twentytwentyfive 45,422
dt-the7 45,081
woodmart 44,434
h4 41,605
neve 37,714
Avada-Child-Theme 36,753
gox 36,245
bridge 30,840
lightning 30,212
twentytwentyone 29,996
twentytwenty 28,495
swell 28,410
bricks 26,568
Impreza 25,863
Newspaper 24,109
twentytwentythree 21,866
epik-redesign 19,010
twentytwentytwo 18,600
uncode 18,258
twentysixteen 17,592
pro 17,485
storefront 16,163
sydney 16,049
Total 14,203
hello-theme-child-master 13,938
factory-templates-4 13,731
themify-ultra 12,861
hestia 12,460
yootheme 12,424
extendable 11,994
yith-wonder 11,973
porto 11,813
twentyfifteen 11,793