WP Consent API & ConsentMagic

ConsentMagic helps you collect and manage your visitors’ consent preferences and send them to the WP Consent API plugin.

Get expert tracking tips in your inbox

Join 65,000+ marketers and site owners who already get our best guides on Meta Pixels, CAPI, GA4, Google Ads, TikTok & Pinterest tracking, GDPR, and more.

* We don’t spam, and all our emails have an “Unsubscribe” link that works. 

How does it work

Get users’ consent options

ConsentMagic informs your visitors and lets them configure category-based consent, as required in many jurisdictions.

Send it to the WP Consent API

The visitor’s options are sent to the WP Consent API plugin immediately.

Other plugins can use it

Any WordPress plugin can get the consent from the WP Consent API and adjust its behaviour accordingly.

What is the WP Consent API plugin?

The WP Consent API is an open standard for handling consent data in WordPress. It provides a single, centralized way for plugins and themes to access a visitor’s consent preferences. Instead of each plugin asking for consent separately, the WP Consent API acts as a shared hub:

  • Collect and store consent choices (by category)

  • Allow other plugins to check those choices

  • Make compliance with GDPR, ePrivacy, and similar laws easier

With this API in place, you avoid fragmented consent handling and ensure consistency across your website.

What the WP Consent API does not do

  • No banner or pop-up. It doesn’t inform users or ask for consent.

  • No consent collection. It doesn’t collect or store choices by itself.

  • No script blocking. It doesn’t load/block tags automatically.

What ConsentMagic does

  • Shows a consent prompt. It displays a banner or popup informing your visitors about cookies and scripts.

  • Asks for category-based consent. Visitors can choose their preferences for each category (for example: Necessary, Analytics, Marketing).

  • Sends choices to the WP Consent API. As soon as users decide, their options are saved in the WP Consent API.

  • Makes data available to other plugins. Any plugin using the WP Consent API can read these choices and adjust automatically.

Extending ConsentMagic’s Native Capabilities

ConsentMagic can block most tracking scripts on its own — even without the WP Consent API. This includes popular scripts like the Meta Pixel, Google Ads tags, TikTok tags, and many others.

The WP Consent API integration is still useful for other purposes — for example, letting form plugins, e-commerce plugins, forums, or any other plugin check a visitor’s consent status before running features or storing data.

In short:

  • Script blocking: Built directly into ConsentMagic.

  • WP Consent API integration: Expands consent handling to all compatible plugins and site features.

Don’t stop here!

Subscribe to get more tips on tracking, analytics, and GDPR.

We’ll send you practical guides on Meta Pixel, CAPI, GA4, Google Ads, TikTok, Pinterest, GDPR compliance, and more, right to your inbox.

* We don’t spam, and all our emails have an “Unsubscribe” link that works.