WordPress filter hook

wp_consent_cookie_prefix

Fired by 11 WordPress plugins, running on 3.4M+ sites between them.

“Filters the consent cookie prefix to integrate with the WordPress Consent API.”

How to use wp_consent_cookie_prefix

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wp_consent_cookie_prefix', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Argument names come from Jetpack's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

11 plugins that fire wp_consent_cookie_prefix

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Jetpack icon Jetpack3+ million installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) jetpack_vendor/automattic/woocommerce-analytics/src/class-consent-manager.php:81
  2. WP Consent API icon WP Consent API300,000+ installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) inc/class-wp-consent-api-config.php:65
  3. SureCookie icon SureCookie80,000+ installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) inc/integrations/wp-consent-api/consent-handler.php:195
  4. Smaily Connect icon Smaily Connect2,000+ installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) includes/Support/MarketingConsent.php:66
  5. BrikPanel: WooCommerce Dashboard & Analytics, Abandoned Cart Recovery, Order Export, Inventory Management & Bulk Editor icon BrikPanel: WooCommerce Dashboard & Analytics, Abandoned Cart Recovery, Order Export, Inventory Management & Bulk Editor1,000+ installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) includes/brikpanel-consent.php:166
  6. Accelerate icon Accelerate30+ installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) inc/analytics/namespace.php:225
  7. Rooster One icon Rooster One10+ installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) includes/consent/class-aieo-consent.php:960
  8. Oriva for WooCommerce icon Oriva for WooCommerceFewer than 10 installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) includes/class-capture.php:64
  9. Datoden Cookie Consent icon Datoden Cookie ConsentFewer than 10 installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) includes/dt-consent-api-lib.php:14
  10. Aopy for WooCommerce icon Aopy for WooCommerceFewer than 10 installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) includes/class-cdm-consent.php:290
  11. Trackdolphin icon TrackdolphinFewer than 10 installs apply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ) includes/class-td-consent.php:72

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.