Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_filter_final_form

Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

This hook can be used to make changes to the rendered form content before it is returned by the form shortcode.

Usage

add_filter( 'frm_filter_final_form', 'filter_hide_this' );
function filter_hide_this( $form )

Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

Parameters

  • $form (string)

Examples

Use shortcode throughout HTML in form

You can use this this example code to place opening and closing shortcode tags to span throughout HTML fields in the form. This particular example shows how to use the shortcode for the Hide This plugin.

add_filter( 'frm_filter_final_form', 'filter_hide_this' );
function filter_hide_this( $form ) {
  global $shortcode_tags;
  $original_shortcodes = $shortcode_tags;
  $limited_shortcodes = array( 'hidethis' => $shortcode_tags['hidethis'] );
  $shortcode_tags = $limited_shortcodes;
  $form = do_shortcode( $form );
  $shortcode_tags = $original_shortcodes;
  return $form;
}

add_filter( 'frm_do_html_shortcodes', '__return_false' );

Minimize the form without the shortcode

The easiest way to minimize the form HTML is by adding minimize=1 to your [formidable] shortcode. But if every form on your site needs to be minimized, you can strip out the white space before it can be converted to <p> or <br/> tags with this:

add_filter( 'frm_filter_final_form', 'auto_minimize_forms' );
function auto_minimize_forms( $form ) {
  $form = str_replace( array( "rn", "r", "n", "t", '    ' ), '', $form );
  return $form;
}

Change a word

Use this code example to change a word or phrase in a form to another word or phrase. For example, you can change the word "Edit" that appears in the Summary field to "Revise."

To use the code example, replace "Edit" with the word or phrase you want to change and "Revise" with the word or phrase to which you want to change it.

Note: this code example will change all occurrences of the word or phrase in the form.

add_filter( 'frm_filter_final_form', 'change_edit_label' );
function change_edit_label( $form ){
    $form = str_replace( 'Edit', 'Revise', $form );
    return $form;
}

Remove icon and instruction

Use this code example to remove the SVG that appears with the press Enter text, as well as the Shift+Tab instructions at the bottom of the page in a Conversational form.

add_filter( 'frm_filter_final_form', 'remove_conversational_html', 15 );
function remove_conversational_html( $html ) {
	// Remove enter icons
	$html = preg_replace( '/<svg(.*?)d="M15.3 6c0 .7-.3 1.2-.7 1.7a2.2 2.2 0 0 1-1.7.7H7.4v2.3L.6 7.5l6.8-3.2v2.3H12c.3 0 .6-.1.8-.3.3-.2.4-.5.4-.8V.7h2V6Z"(.*?)\/><\/svg>/', '', $html, 2 );

	// Remove the "Shift+Tab" instruction
	$html = preg_replace( '/<div class="frm-key-instructions">(.*?)<\/div>/', '', $html, 1 );

	return $html;
}

Skip start page

Use this code to skip the first page with the start button in a Conversational form.

add_filter('frm_filter_final_form', 'skip_start_page', 15);
function skip_start_page( $form ) {
	$form = str_replace(
		'class="frm_active_chat_field frm_chat_start_page"',
		'style="display: none;" class="frm_active_chat_field frm_chat_start_page"',
			$form
		);
	return $form;
}
Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2025 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Complete your purchase
    Special offer unlocked.
    Get 55% OFF!
    Complete Purchase
    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms