HTML Forms icon
Forms

HTML Forms hooks reference

  • By Link Software LLC
  • v1.7.2 New
  • Updated

HTML Forms 1.7.2 has 20 actions and 26 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 HTML Forms fires an action
add_action( 'hf_form_error', function( $error_code, $form, $data ) {
	// Your code runs here.
}, 10, 3 );

// Change a value HTML Forms is about to use
add_filter( 'hf_available_form_actions', function( $actions ) {
	// Change $actions here.
	return $actions;
}, 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

  • src/admin/class-admin.php line 154
    /**
     * Allows you to hook into requests containing `_hf_admin_action` => action
     * name.
     */
    do_action( "hf_admin_action_{$action}" );
  • src/admin/class-admin.php line 536
    /**
     * Filters the available form actions
     */
    apply_filters( 'hf_available_form_actions', $actions );
  • src/class-forms.php line 332
    /**
     * General purpose hook after all form actions have been processed for this
     * specific form. The dynamic portion of the hook refers to the form slug.
     */
    do_action( "hf_form_{$form->slug}_success", $submission, $form );
  • src/class-form.php line 51
    /**
     * Filters the action attribute for this form.
     */
    apply_filters( 'hf_form_element_action_attr', null, $form );
  • src/class-form.php line 43
    /**
     * Filters the CSS classes to be added to this form's class attribute.
     */
    apply_filters( 'hf_form_element_class_attr', '', $form );
  • src/class-form.php line 109
    /**
     * Filters the data attributes to be added to the form attribute.
     */
    apply_filters( 'hf_form_element_data_attributes', $attributes, $form );
  • hf_form_error

    action
    src/class-forms.php line 349
    /**
     * General purpose hook for when a form error occurred
     */
    do_action( 'hf_form_error', $error_code, $form, $data );
  • hf_form_html

    filter
    src/class-form.php line 85
    /**
     * Filters the resulting HTML for this form.
     */
    apply_filters( 'hf_form_html', $html, $form );
  • src/class-forms.php line 340
    /**
     * General purpose hook after all form actions have been processed.
     */
    do_action( 'hf_form_success', $submission, $form );
  • src/class-forms.php line 268
    /**
     * Filters the field names that should be ignored on the Submission object.
     * Fields starting with an underscore (_) are ignored by default.
     */
    apply_filters( 'hf_ignored_field_names', array() );
  • views/tab-actions.php line 34
    /**
     * Output setting fields for a registered action
     */
    do_action( "hf_output_form_action_{$action_settings['type']}_settings", $action_settings, $index++ );
  • views/tab-settings.php line 69
    /**
     * Runs after the form settings are printed.
     */
    do_action( 'hf_output_form_settings_submissions', $form );
  • src/class-forms.php line 305
    /**
     * General purpose hook that runs before all form actions, so we can still
     * modify the submission object that is passed to actions.
     */
    do_action( 'hf_process_form', $form, $submission );
  • src/class-forms.php line 322
    /**
     * Processes the specified form action and passes related data.
     */
    do_action( "hf_process_form_action_{$action_settings['type']}", $action_settings, $submission, $form );
  • views/tab-actions.php line 39
    /**
     * Deprecated action hook. Use the above action (hf_output_form_action_...)
     * instead.
     */
    do_action( "hf_render_form_action_{$action_settings['type']}_settings", $action_settings, $index++ );
  • hf_settings

    filter
    src/functions.php line 204
    /**
     * Filters the global HTML Forms hf_settings
     */
    apply_filters( 'hf_settings', $settings );
  • src/functions.php line 259
    /**
     * Filters the available tags in HTML Forms templates, like
     * {{user.user_email}}.
     */
    apply_filters( 'hf_template_tags', $tags );
  • src/class-forms.php line 155
    /**
     * This filter allows you to perform your own form validation.
     */
    apply_filters( 'hf_validate_form', $error_code, $form, $data );
  • src/class-forms.php line 143
    /**
     * This filter allows you to perform your own form validation. The dynamic
     * portion of the hook refers to the form slug.
     */
    apply_filters( "hf_validate_form_{$form->slug}", $error_code, $form, $data );
  • src/actions/class-email.php line 135
    apply_filters( 'hf_action_email_from', hf_replace_data_variables( $settings['from'], $submission, $sanitize_header_value ), $submission );
  • src/actions/class-email.php line 122
    apply_filters( 'hf_action_email_message', $message, $submission );
  • src/actions/class-email.php line 118
    apply_filters( 'hf_action_email_subject', $subject, $submission );
  • src/actions/class-email.php line 115
    apply_filters( 'hf_action_email_to', $to, $submission );
  • views/tab-submissions-list.php line 11
    apply_filters( 'hf_admin_form_submissions_bulk_actions', array( 'bulk_delete_submissions' => __( 'Delete Permanently' ), ) );
  • src/admin/class-admin.php line 412
    do_action( 'hf_admin_form_submissions_detail', $submission );
  • views/tab-submissions-list.php line 105
    do_action( 'hf_admin_form_submissions_table_output_column_header', $field, $column );
  • views/tab-submissions-list.php line 124
    do_action( 'hf_admin_form_submissions_table_output_row_actions', $s );
  • views/tab-messages.php line 44
    do_action( 'hf_admin_output_form_messages', $form );
  • views/tab-messages.php line 43
    do_action( 'hf_admin_output_form_messages_submissions', $form );
  • views/page-edit-form.php line 67
    do_action( "hf_admin_output_form_tab_{$tab}", $form );
  • views/page-global-settings.php line 99
    do_action( 'hf_admin_output_google_recaptcha_v3_settings' );
  • views/page-global-settings.php line 108
    do_action( 'hf_admin_output_misc_settings' );
  • views/page-global-settings.php line 103
    do_action( 'hf_admin_output_settings' );
  • hf_admin_tabs

    filter
    src/functions.php line 462
    apply_filters( 'hf_admin_tabs', $tabs, $form );
  • src/functions.php line 84
    apply_filters( 'hf_form_default_messages', $default_messages );
  • src/functions.php line 68
    apply_filters( 'hf_form_default_settings', $default_settings );
  • src/class-form.php line 142
    apply_filters( 'hf_form_markup', $this->markup, $this );
  • src/class-form.php line 181
    apply_filters( "hf_form_message_{$code}", $message, $form );
  • src/class-forms.php line 407
    apply_filters( 'hf_form_response', $response, $form, $data );
  • src/actions/class-mailchimp.php line 97
    apply_filters( 'hf_mailchimp_action_merge_fields', $merge_fields, $submission, $form );
  • src/actions/class-mailchimp.php line 102
    apply_filters( 'hf_mailchimp_action_subscriber_data', $mailchimp_data, $submission, $form );
  • views/tab-actions.php line 70
    do_action( "hf_output_form_action_{$type}_settings", array(), '$index' );
  • views/tab-settings.php line 70
    do_action( 'hf_output_form_settings', $form );
  • src/admin/class-recaptcha.php line 192
    apply_filters( 'hf_recaptcha_min_score', 0.5, $form );
  • src/class-forms.php line 110
    apply_filters( 'hf_validate_form_request_size', true );

Generated from HTML Forms'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: