WordPress maintenance or security needs? Reach out!
TLDWP

Plugin: wp-consent-api (Used by 53,133 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
g*s*i*o*.com F Aug 8, 2026
g*a*n*r*d*e.broker (WP 7.0.3) C Aug 8, 2026
l*x*-*o*o*o*.de F Aug 8, 2026
l*p*o*c*n*r*l*.nl (WP 7.0.3) D Aug 8, 2026
t*r*u*a*.hu D Aug 8, 2026
g*t*l*v*s*o*.es (WP 7.0.3) F Aug 8, 2026
m*l*i*t*x.no D Aug 8, 2026
p*a*t*j*v*n*u*s*.nl (WP 7.0.3) C Aug 8, 2026
e*e*g*e*i*i*r.nl (WP 7.0.3) C Aug 8, 2026
h*o*s*e*e*.info F Aug 8, 2026
i*s*e*r.info D Aug 8, 2026
t*m*-*q*a*e.nl (WP 7.0.3) F Aug 8, 2026
m*n*g*-*o*r*t.nl F Aug 8, 2026
y*s*i*l*s.nl F Aug 8, 2026
b*b*i*t*c*h*r*e*i*a.c*m.br (WP 6.9.6) F Aug 8, 2026
u*s*o*o*t*o*.c*m.br (WP 7.0.3) F Aug 8, 2026
m*l*n*e*e*t*.de (WP 7.0.3) F Aug 8, 2026
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

Top 50 Plugins

Plugin Count
elementor 1,770,800
contact-form-7 1,751,038
elementor-pro 1,053,194
woocommerce 817,228
revslider 608,137
jetpack 454,023
js_composer 419,131
wp-rocket 341,762
essential-addons-for-elementor-lite 264,545
gravityforms 256,827
complianz-gdpr 256,512
google-site-kit 233,580
cookie-law-info 228,020
instagram-feed 224,275
sitepress-multilingual-cms 210,518
header-footer-elementor 206,421
google-analytics-for-wordpress 204,873
bluehost-wordpress-plugin 192,441
elementskit-lite 179,964
gutenberg 167,613
cookie-notice 148,298
litespeed-cache 145,730
gtranslate 124,547
wpforms-lite 123,413
the-events-calendar 122,062
astra-sites 112,933
popup-maker 109,462
woocommerce-payments 109,078
gutenberg-core 103,757
tablepress 102,441
honeypot 97,761
astra-addon 93,695
wp-smushit 90,678
duracelltomi-google-tag-manager 90,484
layerslider 88,961
all-in-one-seo-pack 88,878
coblocks 86,972
bb-plugin 86,693
akismet 84,765
premium-addons-for-elementor 84,160
ml-slider 82,467
cleantalk-spam-protect 82,317
mailchimp-for-wp 81,478
megamenu 80,189
woocommerce-gateway-stripe 79,257
jet-engine 78,153
ewww-image-optimizer 76,933
fusion-builder 76,862
wp-pagenavi 76,554
smart-slider-3 76,050

Top 50 Themes

Theme Count
hello-elementor 621,086
Divi 494,757
astra 413,584
flatsome 141,244
Avada 120,740
generatepress 114,796
oceanwp 80,246
kadence 78,437
pub 72,694
enfold 68,508
salient 64,908
twentyseventeen 54,272
bb-theme 53,314
twentytwentyfour 52,540
betheme 52,499
blocksy 50,868
cocoon-master 49,294
dt-the7 45,385
twentytwentyfive 45,240
woodmart 44,090
neve 38,013
Avada-Child-Theme 36,885
gox 36,389
h4 36,284
bridge 31,203
twentytwentyone 30,240
lightning 30,078
twentytwenty 28,719
swell 28,176
bricks 26,581
Impreza 26,030
Newspaper 24,226
twentytwentythree 22,092
epik-redesign 19,107
twentytwentytwo 18,778
uncode 18,436
pro 17,620
twentysixteen 17,578
storefront 16,303
sydney 16,207
Total 14,335
hello-theme-child-master 14,054
factory-templates-4 13,740
themify-ultra 12,961
extendable 12,656
hestia 12,552
yootheme 12,457
yith-wonder 12,069
porto 11,968
twentyfifteen 11,880