PageForge 1.3: Verifique todas as corridas antes de escrever, atualize as páginas geradas, SpinTax e lotes reumáveis. Veja o que mudou
WP Consent API icon
Manutenção ativamente Testado com WP 7.1 #195 most installed plugin #1 in api Comunidade

Consentimento WP API

Consentimento Simples API Para ler e registrar a categoria de consentimento atual.

Instalações ativas300K+Nível 100K+
Downloads · 30d62.7K▼ -20.1% vs prev. 30d
Classificação5/52 comentários
Pontuação da saúde77/100Bom
Downloads de todos os tempos1.3MSince Feb 2020
Suporte resolvido1 / 333% nos últimos 2 meses
RequerWP 5.0Php 7.4+
Classificação geral#195of 75,990 plugins
Nosso veredicto

Escolha sólida

WP Consent API is a solid plugin choice in 2026, with a few things worth checking first. It runs on 300K+ sites, is rated 5/5 and was last updated 2 weeks ago, and scores 77/100 on our health check.

  • Comprovado em escala em mais de 300 mil sites ativos
  • Desenvolvido ativamente — última atualização 2 semanas atrás
  • Testado com as últimas WordPress (7.1)
  • Muito poucos comentários até agora

Como ele se acumula?

Lado a lado em instalações, atualizações, avaliações e suporte

Downloads diários

14.1K28.1K42.2KAug 25Oct 8Nov 22
Ontem1,298
Média diária (1y)1,913
Dia de pico56,248Sep 16, 2026
Últimos 12 meses696.3K

Os picos de download geralmente seguem uma nova versão — cada site que atualiza automaticamente é um download.

Rankings

Where WP Consent API stands today
Popularidade geral #195 of 75,990 WordPress.org plugins Top 0.26%
100K+ Instala o nível 67 of 330
Próximo nível: mais de 500 mil instalações
Api #1 of 507 plugins → Compliance #2 of 194 plugins → Consentimento #2 de 183 plugins → Bolinhos #2 of 200 plugins → Privacidade #2 of 587 plugins →

WordPress.org Classificações de pesquisa

Posição ao vivo na pesquisa de plugins, top 100
Palavra chavePosiçãoPlugins concorrentesCategoria
api #1 10,000 Best api plugins →
compliance #24 6,253 Best compliance plugins →
consentimento #3 4,683 Melhores plugins de consentimento →
cookies #13 4,623 Best cookies plugins →
privacy #32 10,000 Best privacy plugins →

Adoção da versão

Compartilhamento de sites ativos por lançamento.

  • 2.167.7%
  • 2.022.5%
  • 1.09.8%

Divisão de classificação

★★★★★ ★★★★★ 5 de 2 comentários

  • 5★100.0%
  • 4★0.00%
  • 3★0.00%
  • 2★0.00%
  • 1★0.00%

About WP Consent API

Do Readme oficial · v2.1.0

Descrição

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.

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 );
});

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

If your plugin sets the consent type server side with the “wp_get_consent_type” filter, the API passes it to the clientside, and nothing more is needed.

If your plugin sets the consent type in javascript, for example after detecting the visitor’s region, also enable the “wp_consent_api_waitfor_consent_hook” filter. Until the consent type is set, the API treats it as if there is no consent management plugin, and all consent categories return true. With this filter enabled, tracking plugins wait for the “wp_consent_type_defined” event instead.

Set the consent type and dispatch the event on every page load, also for returning visitors who already made a choice.

PHP:

//tell tracking plugins to wait until the consent type is set in javascript
add_filter( 'wp_consent_api_waitfor_consent_hook', '__return_true' );

JavaScript:

//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:
function checkConsent() {
  if (wp_has_consent('marketing')){
    activateMarketing();
    console.log("set marketing stuff now!");
  } else {
    console.log("No marketing stuff please!");
  }
}

//if the consent management plugin sets the consent type in javascript, wait until it is defined
if (window.waitfor_consent_hook && typeof window.wp_consent_type === 'undefined') {
  document.addEventListener('wp_consent_type_defined', checkConsent);
} else {
  checkConsent();
}

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
}

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

Instalação

To install this plugin:

Download the plugin
Upload the plugin to the wp-content/plugins directory,
Go to “plugins” in your WordPress admin, then click activate.

Log de Changes

2.1.0

Change: internally unused wp_set_cookie() function dropped in favor of upcoming WordPress core wp_set_cookie() function.

2.0.1

Fix: typo in ‘preferences’ category, causing comment cookies functionality to follow functional category consent, props @sjinks

2.0.0

  • New: Service-level consent API – allows granular consent control per service in addition to category-based consent
  • New: wp_has_service_consent() function to check if a specific service has consent
  • New: wp_is_service_denied() function to check if a specific service is explicitly denied
  • New: wp_set_service_consent() function to set consent for a specific service
  • New: wp_consent_service_changed action hook fires when service consent changes
  • New: JavaScript functions wp_has_service_consent(), wp_is_service_denied(), and wp_set_service_consent()
  • New: JavaScript event wp_consent_api_status_change_service for service consent changes
  • Improvement: Added type hints throughout codebase for better code quality and IDE support
  • Improvement: Added init() method for cleaner plugin initialization
  • Security: escape logged notice in _doing_it_wrong function, props @mujuonly

1.0.8

  • Updated tested up to
  • Dropped loading of translations, and loading of plugin_data, to prevent translation loading notices by WordPress 6.7, props @mujuonly
  • Dropped obsolete function wp_has_cookie_info, props @szepeviktor

1.0.7

  • Testado até

1.0.6

  • Testado até

Registro de change completo em WordPress.org →

Para desenvolvedores

Este é o seu plugin? Mostre os números.

Adicione um crachá ao vivo ao seu site, Documentos ou Readme do GitHub. Ele é atualizado por conta própria - nenhuma conta necessária.

Selo de Instalações Ativas Selo de classificação Distintivo de pontuação de saúde

Best WP Consent API alternatives

All api plugins →
Alternativas
Classificação Plugin Instalações ativas Classificação Atualizada Saúde
2 Desativar REST API Desativar REST API Desative o uso do resto API no seu site para os usuários do site. Agora, com o suporte ao papel do usuário! Por Dave McHale 80K+ ★★★★★★★★★★ 4.8 (38) 3 anos atrás 37
3 Mailgun for WordPress Mailgun for WordPress Easily send email from your WordPress site through Mailgun using the HTTP API or SMTP. by Mailgun 70K+ ★★★★★★★★★★ 3.8 (49) 2 meses atrás 81
4 Make Connector Make Connector Make Connector. Make lets you design, build, and automate by connecting with WordPress in… by Make 70K+ ★★★★★★★★★★ 2.9 (27) 3 semanas atrás 69
5 Desative o WP REST API Desative o WP REST API Desativa o WP REST API para visitantes não conectados WordPress. Por Jeff Starr 30K+ ★★★★★★★★★★ 4.8 (36) 3 meses atrás 84
6 WP REST Cache WP REST Cache Enable caching of the WordPress REST API and auto-flush caches upon wp-admin editing. by Acato 10K+ ★★★★★★★★★★ 4.9 (42) 3 semanas atrás 89
7 WPGraphQL for ACF WPGraphQL for ACF WPGraphQL for ACF seamlessly integrates Advanced Custom Fields with WPGraphQL. by Jason Bahl 10K+ ★★★★★★★★★★ 5 (1) 2 semanas atrás 75
8 WPGet API – Connect to any external REST API WPGet API – Connect to any external REST API Connect any REST API to WordPress. WPGet API enables easy API integration, allowing you to… Por David Anderson / Team Updraft 10K+ ★★★★★★★★★★ 5 (32) 5 dias atrás 94
9 WordPress REST API (Version 2) WordPress REST API (Version 2) Access your site's data through an easy-to-use HTTP REST API. (Version 2) by Ryan McCue 10K+ ★★★★★★★★★★ 4.2 (34) 9 anos atrás 43
10 WP REST API Controller WP REST API Controller Enable a UI to toggle visibility and customize properties in WP REST API requests. Por Evan Herman 7K+ ★★★★★★★★★★ 4.3 (12) 4 anos atras 38
11 WP REST API – OAuth 1.0a Server WP REST API – OAuth 1.0a Server Connect applications to your WordPress site without ever giving away your password. by Joe Hoyle 7K+ ★★★★★★★★★★ 3.7 (7) 2 anos atrás 36

FAQ

WP Consent API: quick answers

Respostas diretas, extraídas de dados ao vivo WordPress.org.

Fonte: WordPress.org

Is WP Consent API free?

Yes. WP Consent API is free to download and use from the official WordPress.org plugin directory.

Is WP Consent API safe to use in 2026?

WP Consent API is a solid plugin choice in 2026, with a few things worth checking first. It runs on 300K+ sites, is rated 5/5 and was last updated 2 weeks ago, and scores 77/100 on our health check.

How many websites use WP Consent API?

WP Consent API is active on 300K+ WordPress websites and has been downloaded 1,272,236 times since it launched in February 2020. It was downloaded 62,701 times in the last 30 days.

Does WP Consent API work with WordPress 7.1?

Yes. The developer has tested WP Consent API up to WordPress 7.1.5, the latest release. It requires WordPress 5.0 or newer.

What PHP version does WP Consent API need?

WP Consent API requires PHP 7.4 or higher. Most hosts run PHP 8.x today, so it works on any modern WordPress hosting.

When was WP Consent API last updated?

The latest version, 2.1.0, was released on November 9, 2026 (2 weeks ago).

Who makes WP Consent API?

WP Consent API is developed and maintained by Rogier Lankhorst.

What are the best alternatives to WP Consent API?

The most popular alternatives to WP Consent API are Disable REST API (80K+ installs), Mailgun for WordPress (70K+ installs) and Make Connector (70K+ installs).

Alimentado por PageForge

Um modelo e uma planilha. Uma página real para cada pesquisa.

PageForge Transforma cada linha de um CSV em uma página WordPress com seu próprio título, URL, SEO campos e esquema, construído no layout que você já desenhou. Gratuito em WordPress.org.

  • CSV e XLSX, mais Google Sheets em Profissional e Empresarial
  • Seu próprio título, URL, SEO campos e esquema para cada página
  • Funciona com o editor de blocos, Elementor, Divi e Avada
  • Gratuito em WordPress.org, sem cartão de crédito

↑↓ mover↵ abrir