shortcodes in gravity forms

Shortcodes Inside Gravity Forms

The ability to use shortcodes in quite a few areas of WordPress isn’t enabled by default. An example of this behavior is WordPress widgets or WordPress post titles, where you need to add a filter to enable the same inside the same.

While not as often in widgets, if you do come across a situation whereby you need to use a shortcode inside a form created with The Gravity Forms Plugin, you’ll find that it will do not output its value by default.

gravity forms shortcodes

To change this behavior and enable the use of shortcodes inside Gravity Forms’ title, description and other fields such as a text field, textarea field, checkboxes etc., add the following to your theme’s functions.php file.


/* Enable Shortcode in Gravity Forms */

add_filter( 'gform_get_form_filter', 'shortcode_unautop', 11 );
add_filter( 'gform_get_form_filter', 'do_shortcode', 11 );

That’s it – two simple filters that will enable the use of shortcodes inside Gravity Forms.