Contact Form 7 icon
Forms

Contact Form 7 hooks reference

  • By Rock Lobster Inc
  • v6.2.5 New
  • Updated

Contact Form 7 6.2.5 has 28 actions and 93 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 Contact Form 7 fires an action
add_action( 'wpcf7_admin_notices', function( $arg1, $current_action, $arg3 ) {
	// Your code runs here.
}, 10, 3 );

// Change a value Contact Form 7 is about to use
add_filter( 'wpcf7_kses_allowed_html', function( $allowed_tags, $context ) {
	// Change $allowed_tags here.
	return $allowed_tags;
}, 10, 2 );

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

  • admin/contact-forms.php line 66 · used in 4 places
    do_action( 'wpcf7_admin_notices', 'wpcf7', wpcf7_current_action(), null );
  • admin/contact-forms.php line 62 · used in 4 places
    do_action( 'wpcf7_admin_warnings', 'wpcf7', wpcf7_current_action(), null );
  • admin/admin.php line 249 · used in 3 places
    do_action( 'wpcf7_admin_load', wpcf7_superglobal_get( 'page' ), wpcf7_current_action() );
  • includes/formatting.php line 407 · used in 2 places
    apply_filters( 'wpcf7_kses_allowed_html', $allowed_tags[$context], $context );
  • includes/mail.php line 632 · used in 2 places
    apply_filters( 'wpcf7_special_mail_tags', null, $mail_tag->tag_name(), $html, $mail_tag );
  • modules/recaptcha/recaptcha.php line 45 · used in 2 places
    apply_filters( 'wpcf7_use_recaptcha_net', false );
  • includes/functions.php line 521
    apply_filters( 'deprecated_hook_trigger_error', true );
  • includes/submission.php line 596
    apply_filters( 'wpcf7_acceptance', true, $this );
  • includes/submission.php line 751
    apply_filters( 'wpcf7_additional_mail', $additional_mail, $contact_form );
  • admin/admin.php line 16
    do_action( 'wpcf7_admin_init' );
  • admin/admin.php line 29
    do_action( 'wpcf7_admin_menu' );
  • admin/admin.php line 99
    apply_filters( 'wpcf7_admin_menu_change_notice', array( 'wpcf7' => 0, 'wpcf7-new' => 0, 'wpcf7-integration' => 0, ) );
  • admin/edit-contact-form.php line 281
    do_action( 'wpcf7_admin_misc_pub_section', $post_id );
  • includes/contact-form.php line 1301
    do_action( 'wpcf7_after_create', $this );
  • modules/flamingo.php line 183
    do_action( 'wpcf7_after_flamingo', $result );
  • includes/contact-form.php line 1306
    do_action( 'wpcf7_after_save', $this );
  • includes/contact-form.php line 1303
    do_action( 'wpcf7_after_update', $this );
  • modules/akismet/akismet.php line 239
    apply_filters( 'wpcf7_akismet_comment_check', $spam, $comment );
  • modules/akismet/akismet.php line 79
    apply_filters( 'wpcf7_akismet_parameters', $comment );
  • includes/functions.php line 221
    apply_filters( 'wpcf7_autop_or_not', WPCF7_AUTOP, $options );
  • includes/submission.php line 715
    do_action_ref_array( 'wpcf7_before_send_mail', array( $this->contact_form, &$abort, $this, ) );
  • modules/really-simple-captcha.php line 412
    apply_filters( 'wpcf7_captcha_url', sanitize_url( $url ) );
  • includes/contact-form.php line 1006
    apply_filters( 'wpcf7_collect_mail_tags', $mailtags, $options, $this );
  • includes/config-validator/validator.php line 277
    apply_filters( 'wpcf7_config_validator_available_error_codes', self::error_codes, $this->contact_form );
  • includes/config-validator/validator.php line 339
    do_action( 'wpcf7_config_validator_validate', $this );
  • includes/contact-form.php line 226
    do_action( 'wpcf7_contact_form', $this );
  • includes/contact-form.php line 149
    apply_filters( 'wpcf7_contact_form_default_pack', $contact_form, $options );
  • includes/contact-form.php line 320
    apply_filters( 'wpcf7_contact_form_properties', $properties, $this );
  • includes/contact-form.php line 312
    apply_filters( "wpcf7_contact_form_property_{$name}", $val, $this );
  • includes/contact-form.php line 1377
    apply_filters( 'wpcf7_contact_form_shortcode', $shortcode, $options, $this );
  • wpcf7_copy

    filter
    includes/contact-form.php line 1324
    apply_filters( 'wpcf7_copy', $new, $this );
  • admin/includes/dashboard.php line 50
    do_action( 'wpcf7_dashboard_setup' );
  • includes/contact-form-template.php line 20
    apply_filters( 'wpcf7_default_template', $template, $prop );
  • includes/contact-form.php line 1125
    apply_filters( 'wpcf7_display_message', $message, $status );
  • wpcf7_do_doi

    filter
    modules/doi-helper.php line 32
    apply_filters( 'wpcf7_do_doi', ! $contact_form->is_false( 'doi' ), $agent_name, $args );
  • wpcf7_doi

    action
    modules/sendinblue/sendinblue.php line 151
    do_action_ref_array( 'wpcf7_doi', array( 'wpcf7_sendinblue', array( 'email_to' => $attributes['EMAIL'], 'properties' => $params, ), &$token, ) );
  • admin/edit-contact-form.php line 390
    apply_filters( 'wpcf7_editor_panels', $panels );
  • includes/controller.php line 130
    do_action( 'wpcf7_enqueue_scripts' );
  • includes/controller.php line 152
    do_action( 'wpcf7_enqueue_styles' );
  • includes/rest-api.php line 410
    apply_filters( 'wpcf7_feedback_response', $response, $result );
  • includes/formatting.php line 357
    apply_filters( 'wpcf7_file_extension_safelist', $safelist );
  • modules/flamingo.php line 205
    apply_filters( 'wpcf7_flamingo_get_value', $value, $field, $contact_form );
  • modules/flamingo.php line 158
    apply_filters( 'wpcf7_flamingo_inbound_message_parameters', $args );
  • modules/flamingo.php line 24
    apply_filters( 'wpcf7_flamingo_submit_if', array( 'spam', 'mail_sent', 'mail_failed' ) );
  • includes/contact-form.php line 564
    apply_filters( 'wpcf7_form_action_url', $action_url );
  • includes/contact-form.php line 654
    apply_filters( 'wpcf7_form_additional_atts', array() );
  • includes/contact-form.php line 638
    apply_filters( 'wpcf7_form_autocomplete', '' );
  • includes/contact-form.php line 635
    apply_filters( 'wpcf7_form_class_attr', $class );
  • includes/contact-form.php line 961
    apply_filters( 'wpcf7_form_elements', $this->replace_all_form_tags() );
  • includes/contact-form.php line 637
    apply_filters( 'wpcf7_form_enctype', '' );
  • includes/contact-form.php line 729
    apply_filters( 'wpcf7_form_hidden_fields', array() );
  • includes/contact-form.php line 597
    apply_filters( 'wpcf7_form_id_attr', preg_replace( '/[^A-Za-z0-9:._-]/', '', $options['html_id'] ) );
  • includes/contact-form.php line 601
    apply_filters( 'wpcf7_form_name_attr', preg_replace( '/[^A-Za-z0-9:._-]/', '', $options['html_name'] ) );
  • includes/contact-form.php line 775
    apply_filters( 'wpcf7_form_response_output', $output, $class, $content, $this, $status );
  • includes/form-tags-manager.php line 560
    apply_filters( 'wpcf7_form_tag', $scanned_tag, $replace );
  • includes/form-tag.php line 519
    apply_filters( 'wpcf7_form_tag_data_option', null, $options, $args );
  • includes/form-tag.php line 336
    apply_filters( 'wpcf7_form_tag_date_option', null, array( $option_name => $option_value ) );
  • includes/contact-form.php line 605
    apply_filters( 'wpcf7_form_title_attr', $options['html_title'] );
  • wpcf7_init

    action
    load.php line 155
    do_action( 'wpcf7_init' );
  • wpcf7_is_date

    filter
    includes/validation-functions.php line 110
    apply_filters( 'wpcf7_is_date', $result, $text );
  • includes/validation-functions.php line 26
    apply_filters( 'wpcf7_is_email', $result, $text );
  • includes/validation-functions.php line 90
    apply_filters( 'wpcf7_is_number', $result, $text );
  • wpcf7_is_tel

    filter
    includes/validation-functions.php line 66
    apply_filters( 'wpcf7_is_tel', $result, $text );
  • wpcf7_is_time

    filter
    includes/validation-functions.php line 138
    apply_filters( 'wpcf7_is_time', $result, $text );
  • wpcf7_is_url

    filter
    includes/validation-functions.php line 36
    apply_filters( 'wpcf7_is_url', $result, $text );
  • includes/functions.php line 237
    apply_filters( 'wpcf7_load_css', WPCF7_LOAD_CSS );
  • wpcf7_load_js

    filter
    includes/functions.php line 229
    apply_filters( 'wpcf7_load_js', WPCF7_LOAD_JS );
  • includes/functions.php line 630
    apply_filters( 'wpcf7_log_remote_request', $log, $url, $request, $response );
  • includes/mail.php line 241
    apply_filters( 'wpcf7_mail_components', $components, wpcf7_get_current_contact_form(), $this );
  • includes/submission.php line 134
    do_action( 'wpcf7_mail_failed', $contact_form );
  • includes/mail.php line 214
    apply_filters( 'wpcf7_mail_html_body', $body, $this );
  • includes/mail.php line 203
    apply_filters( 'wpcf7_mail_html_header', '<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"' . $lang_atts . '> <head> <title>' . esc_html( $this->get( 'subject', true ) ) . '</title> </head> <body> ', $this );
  • includes/submission.php line 129
    do_action( 'wpcf7_mail_sent', $contact_form );
  • includes/mail.php line 620
    apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted, $html, $mail_tag );
  • includes/mail.php line 614
    apply_filters( "wpcf7_mail_tag_replaced_{$type}", $replaced, $submitted, $html, $mail_tag );
  • admin/includes/list-table.php line 115
    do_action( 'wpcf7_manage_custom_column', $column_name, $item->id() );
  • includes/capabilities.php line 19
    apply_filters( 'wpcf7_map_meta_cap', $meta_caps );
  • includes/contact-form-template.php line 205
    apply_filters( 'wpcf7_messages', $messages );
  • includes/submission.php line 408
    apply_filters( 'wpcf7_posted_data', $posted_data );
  • includes/submission.php line 395
    apply_filters( "wpcf7_posted_data_{$tag->type}", $value, $value_orig, $tag );
  • includes/contact-form.php line 286
    apply_filters( 'wpcf7_pre_construct_contact_form_properties', $builtin_properties, $this );
  • modules/recaptcha/recaptcha.php line 86
    apply_filters( 'wpcf7_recaptcha_actions', array( 'homepage' => 'homepage', 'contactform' => 'contactform', ) );
  • modules/recaptcha/service.php line 85
    apply_filters( 'wpcf7_recaptcha_secret', $secret );
  • modules/recaptcha/service.php line 68
    apply_filters( 'wpcf7_recaptcha_sitekey', $sitekey );
  • modules/recaptcha/service.php line 186
    apply_filters( 'wpcf7_recaptcha_threshold', 0.50 );
  • modules/recaptcha/service.php line 170
    apply_filters( 'wpcf7_recaptcha_verify_response', $is_human, $response_body );
  • includes/rest-api.php line 458
    apply_filters( 'wpcf7_refill_response', array() );
  • includes/submission.php line 529
    apply_filters( 'wpcf7_remote_ip_addr', $ip_addr );
  • includes/contact-form-functions.php line 356
    do_action( 'wpcf7_save_contact_form', $contact_form, $data, $context );
  • modules/sendinblue/sendinblue.php line 251
    apply_filters( 'wpcf7_sendinblue_collect_parameters', $params );
  • modules/sendinblue/sendinblue.php line 101
    apply_filters( 'wpcf7_sendinblue_contact_parameters', array( 'email' => $attributes['EMAIL'], 'attributes' => (object) $attributes, 'listIds' => (array) $prop['contact_lists'], 'updateEnabled' => false, ) );
  • modules/sendinblue/doi.php line 29
    apply_filters( 'wpcf7_sendinblue_doi_email_callback', 'wpcf7_sendinblue_doi_default_email_callback' );
  • modules/sendinblue/doi.php line 25
    apply_filters( 'wpcf7_sendinblue_doi_optin_callback', 'wpcf7_sendinblue_doi_default_optin_callback' );
  • modules/sendinblue/sendinblue.php line 132
    apply_filters( 'wpcf7_sendinblue_email_parameters', array( 'templateId' => absint( $prop['email_template'] ), 'to' => array( array( 'name' => $email_to_name, 'email' => $attributes['EMAIL'], ), ), 'params' => (object) $attributes, 'tags' => array( 'Contact Form 7' ), ) );
  • includes/contact-form-functions.php line 288
    do_action( 'wpcf7_shortcode_callback', $contact_form, $atts );
  • includes/submission.php line 731
    apply_filters( 'wpcf7_skip_mail', $this->skip_mail, $contact_form );
  • includes/submission.php line 630
    apply_filters( 'wpcf7_skip_spam_check', $this->skip_spam_check, $this );
  • wpcf7_spam

    filter
    includes/submission.php line 666
    apply_filters( 'wpcf7_spam', $spam, $this );
  • modules/stripe/stripe.php line 307
    apply_filters( 'wpcf7_stripe_payment_intent_parameters', $pi_params );
  • modules/disallowed-list.php line 31
    apply_filters( 'wpcf7_submission_has_disallowed_words', $word, $submission );
  • includes/submission.php line 204
    apply_filters( 'wpcf7_submission_result', $result, $this );
  • wpcf7_submit

    action
    includes/contact-form.php line 1091
    do_action( 'wpcf7_submit', $this, $result );
  • includes/contact-form.php line 551
    apply_filters( 'wpcf7_subscribers_only_notice', $notice, $this );
  • includes/functions.php line 189
    apply_filters( 'wpcf7_support_html5_fallback', false );
  • includes/swv/swv.php line 44
    apply_filters( 'wpcf7_swv_available_rules', $rules );
  • includes/swv/schema-holder.php line 26
    do_action( 'wpcf7_swv_create_schema', $schema, $this );
  • modules/turnstile/service.php line 100
    apply_filters( 'wpcf7_turnstile_secret', $secret );
  • modules/turnstile/service.php line 88
    apply_filters( 'wpcf7_turnstile_sitekey', $sitekey );
  • load.php line 128
    do_action( 'wpcf7_update_option', $name, $value, $old_option );
  • wpcf7_upgrade

    action
    load.php line 172
    do_action( 'wpcf7_upgrade', $new_ver, $old_ver );
  • includes/functions.php line 66
    apply_filters( 'wpcf7_upload_dir', array( 'dir' => $uploads['basedir'], 'url' => $uploads['baseurl'], ) );
  • includes/file.php line 57
    apply_filters( 'wpcf7_upload_file_name', $filename, $name, $options );
  • includes/functions.php line 197
    apply_filters( 'wpcf7_use_really_simple_captcha', WPCF7_USE_REALLY_SIMPLE_CAPTCHA );
  • includes/submission.php line 584
    apply_filters( 'wpcf7_validate', $result, $tags );
  • includes/submission.php line 865
    apply_filters( "wpcf7_validate_{$tag->type}", $result, $tag, array( 'uploaded_files' => $uploaded_files, ) );
  • includes/submission.php line 581
    apply_filters( "wpcf7_validate_{$type}", $result, $tag );
  • includes/functions.php line 207
    apply_filters( 'wpcf7_validate_configuration', WPCF7_VALIDATE_CONFIGURATION );
  • includes/contact-form.php line 877
    apply_filters( 'wpcf7_validation_error', $error, $name, $this );
  • includes/contact-form.php line 1211
    apply_filters( 'wpcf7_verify_nonce', $is_active, $this );

Generated from Contact Form 7'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: