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.
// 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
-
cn_manage_cookie_notice_cap
filterapply_filters( 'cn_manage_cookie_notice_cap', 'manage_options' ); -
wpml_translate_single_string
filterapply_filters( 'wpml_translate_single_string', $options['revoke_text'], 'Cookie Notice', 'Revoke button text' ); -
wpml_register_single_string
actiondo_action( 'wpml_register_single_string', 'Cookie Notice', 'Message in the notice', $options['message_text'] ); -
cn_configuration_updated
actiondo_action( 'cn_configuration_updated', 'privacy-consent', $input ); -
apply_filters( 'cn_manage_network_cookie_notice_cap', 'manage_network_options' ); -
cn_refuse_code_scripts_html
filterapply_filters( 'cn_refuse_code_scripts_html', $cn->options['general']['refuse_code'], 'body' ); -
wpsc_add_cookie
actiondo_action( 'wpsc_add_cookie', 'cookie_notice_accepted' ); -
wpsc_delete_cookie
actiondo_action( 'wpsc_delete_cookie', 'cookie_notice_accepted' ); -
breeze_clear_all_cache
actiondo_action( 'breeze_clear_all_cache' ); -
cn_conditional_display
filterapply_filters( 'cn_conditional_display', $final_access, $object ); -
apply_filters( 'cn_cookie_compliance_amp_iframe_url', $this->add_subdomain_to_url( get_site_url(), 'www' ) ); -
cn_cookie_compliance_args
filterapply_filters( 'cn_cookie_compliance_args', $options ); -
cn_cookie_compliance_output
filterapply_filters( 'cn_cookie_compliance_output', $output, $options ); -
cn_cookie_expiry
filterapply_filters( 'cn_cookie_expiry', [ 'hour' => [ __( 'An hour', 'cookie-notice' ), HOUR_IN_SECONDS ], 'day' => [ __( '1 day', 'cookie-notice' ), DAY_IN_SECONDS ], 'week' => [ __( '1 week', 'cookie-notice' ), WEEK_IN_SECONDS ], 'month' => [ __( '1 month', 'cookie-notice' ), MONTH_IN_SECONDS ], '3months' => [ __( '3 months', 'cookie-notice' ), 7862400 ], '6months' => [ __( '6 months', 'cookie-notice' ), 15811200 ], 'year' => [ __(... ); -
cn_cookie_notice_args
filterapply_filters( 'cn_cookie_notice_args', [ 'position' => $banner_position, 'css_class' => $cn->options['general']['css_class'], 'button_class' => 'cn-button', 'colors' => $cn->options['general']['colors'], 'message_text' => $cn->options['general']['message_text'], 'accept_text' => $cn->options['general']['accept_text'], 'refuse_text' => $cn->options['general']['refuse_text'], 'revoke_message_text' => $cn->options['general']['revoke_me... ); -
cn_cookie_notice_output
filterapply_filters( 'cn_cookie_notice_output', wp_kses_post( $output ), $options ); -
cn_is_bot
filterapply_filters( 'cn_is_bot', $cn->bot_detect->is_crawler() ); -
cn_is_cookie_accepted
filterapply_filters( 'cn_is_cookie_accepted', $result ); -
cn_is_cookie_set
filterapply_filters( 'cn_is_cookie_set', $result ); -
cn_is_preview_mode
filterapply_filters( 'cn_is_preview_mode', false ); -
cn_refuse_code_allowed_html
filterapply_filters( 'cn_refuse_code_allowed_html', array_merge( wp_kses_allowed_html( 'post' ), $allowed_html ), $type ); -
apply_filters( 'cookie_notice_gravity_forms_recaptcha_enabled', true ); -
apply_filters( 'cookie_notice_wp_consent_api_enabled', $option_enabled ); -
wpcf7_recaptcha_actions
filterapply_filters( 'wpcf7_recaptcha_actions', [ 'homepage' => 'homepage', 'contactform' => 'contactform' ] ); -
wphb_clear_page_cache
actiondo_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: