Cookie Compliance for WordPress icon
Analytics & Tracking

Cookie Compliance for WordPress hooks reference

  • By Humanityco
  • v3.1.19 New
  • Updated

Cookie Compliance for WordPress 3.1.19 has 6 actions and 20 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when Cookie Compliance for WordPress fires an action
add_action( 'wpml_register_single_string', function( $arg1, $arg2, $options ) {
	// Your code runs here.
}, 10, 3 );

// Change a value Cookie Compliance for WordPress is about to use
add_filter( 'cn_manage_cookie_notice_cap', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • cookie-notice.php line 2536 · used in 10 places
    apply_filters( 'wpml_translate_single_string', $options['revoke_text'], 'Cookie Notice', 'Revoke button text' );
  • includes/settings.php line 2491 · used in 8 places
    do_action( 'wpml_register_single_string', 'Cookie Notice', 'Message in the notice', $options['message_text'] );
  • includes/privacy-consent.php line 194 · used in 6 places
    do_action( 'cn_configuration_updated', 'privacy-consent', $input );
  • includes/frontend.php line 1495 · used in 2 places
    apply_filters( 'cn_refuse_code_scripts_html', $cn->options['general']['refuse_code'], 'body' );
  • includes/modules/breeze/breeze.php line 153
    do_action( 'breeze_clear_all_cache' );
  • includes/frontend.php line 535
    apply_filters( 'cn_conditional_display', $final_access, $object );
  • cn_is_bot

    filter
    includes/frontend.php line 400
    apply_filters( 'cn_is_bot', $cn->bot_detect->is_crawler() );
  • includes/frontend.php line 431
    apply_filters( 'cn_is_preview_mode', false );
  • cookie-notice.php line 2954
    apply_filters( 'cn_refuse_code_allowed_html', array_merge( wp_kses_allowed_html( 'post' ), $allowed_html ), $type );
  • cookie-notice.php line 1238
    apply_filters( 'cn_shared_app_scan_limit', $default );
  • includes/modules/contact-form-7/contact-form-7.php line 57
    apply_filters( 'wpcf7_recaptcha_actions', [ 'homepage' => 'homepage', 'contactform' => 'contactform' ] );
  • includes/modules/hummingbird/hummingbird.php line 92
    do_action( 'wphb_clear_page_cache' );

Generated from Cookie Compliance for WordPress's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: