I want to exclude some fields from Gravity Forms notifications

4 0

By default the Gravity Forms {all_fields} merge tag in notifications includes all fields which had data entered, it doesn’t include HTML fields, Section Break descriptions, nor does it allow you to omit fields from the notification.

By adding the this code to your themes functions.php file you will gain the ability to include HTML fields, and Section Break field descriptions of your choice in the notifications and exclude fields of your choice from appearing in the notifications. HTML fields will be treated just like any other field so you may want to give them more meaningful labels otherwise the notification will just include the default “HTML Block” label. Also if your form uses conditional logic and your HTML field is hidden at the time the form is submitted the HTML field will not be included in the notification.

E.g. {all_fields:exclude[2,3]} would excluding fields 2 and 3 from the all_fields output.

Note: does not work with the product summary table.

If you’re going to use this snippet for adding section breaks to your notifications, be sure to read this.

Leave Your Observation

Your email address will not be published. Required fields are marked *