Skip to main content
Agency Program Get 2× more leads and save 50% on hosting. Built for agencies ready to grow. Book a call
WP Consent API icon

WP Consent API

v1.0.8
by Rogier Lankhorst · 5.0 (1 reviews)

Simple Consent API to read and register the current consent category.

200K+ active installs Updated Oct 06, 2025 Tested to 6.8.3 Requires PHP 5.6
Try Demo Download
Pre-installed Ready in ~10s No card
WP Consent API

About WP Consent API

The WP Consent API plugin helps improve compliance with privacy laws by standardizing communication between cookie banner plugins and other plugins that set cookies or track user data. It allows all supporting plugins to use the same set of methods to read and register the current consent category. However, it is important to note that this plugin itself does not handle consent, it only facilitates communication between plugins.

Frequently asked questions

What problem does this plugin solve?
This plugin standardizes communication of accepted consent categories between plugins. It helps address issues where consent management plugins cannot prevent PHP cookies or block minified JavaScript tracking codes. It also provides a generic API for plugins to adhere to, facilitating site compliance.
Does usage of this API prevent third-party services from tracking user data?
This API primarily targets compliant first-party cookies or tracking by WordPress plugins. If a plugin triggers a service like Facebook, this API can help. For embedded third-party iframes, a blocking tool is still needed.
What does this plugin do?
WP Consent API standardizes how plugins communicate accepted consent categories. It allows consent management plugins and other plugins to work together using the same methods to read and register consent categories. This improves compliance with privacy laws.

Changelog

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

  • Tested up to

1.0.7

  • Tested up to

1.0.6

  • Tested up to

1.0.5

  • tested up to

1.0.4

  • Improvement: only fire on change event if an actual change was detected on the consent.

1.0.3

  • Fix: wp_has_consent function contained a condition which caused it to always return true on serverside optin consent checks.

1.0.2

  • Fix $collected_personal_data documentation, as $is_personal_data was deprecated (props @jazzsequence, https://github.com/rlankhorst/wp-consent-level-api/issues/54)
  • Fix the docblock so it reflects the actual value returned (props @jazzsequence, https://github.com/rlankhorst/wp-consent-level-api/issues/52)
  • Styling changes to site health
  • Code structure changes
  • Removed is_personal_data property, as it’s implicitly contained in the personaldata property
  • Made cookie prefix filterable props @jazzsequence

1.0.1

  • Cookiebot added as existing integration
  • Some small improvements to comply with WordPress coding styles

1.0.0

  • changed consent_api_setcookie into consent_api_set_cookie for naming consistency with the getcookie method
  • added prefix in javascript set and get methods, to be compatible with PHP cookies, props @phpgeek
  • removed duplicate statistics category, props @phpgeek

Try other plugins

Yoast SEO icon

Yoast SEO

4.8 · 10M+ installs

Improve your WordPress SEO: Write better content and have a fully optimized WordPress site using the Yoast SEO…

Classic Editor icon

Classic Editor

4.9 · 9M+ installs

Enables the previous "classic" editor and the old-style Edit Post screen with TinyMCE, Meta Boxes, etc. Supports all…

LiteSpeed Cache icon

LiteSpeed Cache

4.8 · 7M+ installs

All-in-one unbeatable acceleration & PageSpeed improvement: caching, image/CSS/JS optimization...