WP Consent API is an open-source WordPress plugin that provides a standardized way for plugins and themes to communicate cookie consent status with each other. It acts as a bridge between a cookie consent plugin and other plugins that set cookies on a WordPress site.
Without a consent API, each plugin on a WordPress site operates independently. This means that even if a visitor declines cookies through a consent banner, other plugins may still set cookies because they have no way of knowing the visitor’s consent status. WP Consent API solves this problem by creating a shared communication layer.
How Does It Work?
When a visitor interacts with a cookie consent banner, the consent plugin registers the visitor’s preferences through the WP Consent API. Other plugins that are integrated with the API can then read this consent status and act accordingly, either setting or withholding cookies based on what the visitor has agreed to.