August 31, 2023: Added support for using specific inputs in the
:filter
modifier.May 2, 2023: Added support for parsing modifiers that include underscores (e.g.
:my_custom_modifier
).February 9, 2022: Fixed issue where Signature field images would not show if using the
:filter
modifier and GF Signature 4.0 or newer.January 19, 2022: Added support for excluding Consent field descriptions using the
:exclude
modifier.November 3, 2021: Added support for excluding specific child fields from a Nested Form field via the
:exclude
modifier.October 1, 2021: Added the
gwaft_template_paths
filter to allow filtering the available template paths including adding a custom path.June 16, 2021: Fixed an issue where
nopricingfields
may still show "Order Summary" label when other modifiers are used.June 14, 2021: Fixed an issue where "Order Summary" label would still appear when using
nopricingfields
modifier.April 16, 2021: Added support for filtering via custom function.
November 9, 2020: Added support for excluding specific inputs of multi-input fields via the
:exclude
modifier.November 3, 2020: Migrated snippet to the Snippet Library.
January 27, 2020: Added
:nopricingfields
modifier to hide pricing fields from{all_fields}
output.September 5, 2019: Fixed notices generated in PHP7.3 by
continue
statements inside a foreach/switch.April 11, 2019: Updated priority of template replacement to avoid conflict with other merge tags replacement plugins.
The Gravity Forms {all_fields}
merge tag provides a super simple way to output all of the submitted form data but it’s notoriously difficult to customize.
This simple Gravity Forms plugin provides templating support for the {all_fields}
merge tag. Huh? It means you can replace the markup generated by the merge tag with the contents of a file. This tutorial offers a solid starter template file too!
Getting Started
This tutorial assumes you’re running a recent version of Gravity Forms, that you already have the {all_fields}
merge tag implemented wherever you want, and that you ♥ Gravity Wiz.
![]() |
Download, install, and activate the plugin. |
![]() |
Download the sample template directory/file. Add the folder to your active theme’s root directory: /wp-content/themes/{your-theme}/
|
![]() |
Customize the template as desired. |
Template and Merge Tag Options
This plugin provides a few handy modifiers for controlling which template will be used to render the {all_fields}
merge tag.
Note: All template paths are relative to your theme’s root directory.
Default Templates
Merge Tag | Template |
---|---|
{all_fields} | /gravity-forms/all-fields.php |
Form-specific Template
Providing a form-specific template requires no changes to the merge tag. Simply append the targeted form ID to your template’s name. This template will now only be used when the merge tag is used in the context of the specified form.
Merge Tag | Template |
---|---|
{all_fields} | /gravity-forms/all-fields.php /gravity-forms/all-fields-1.php |
Custom Template
You may want to create a custom template that should only be applied to specific instances of the merge tag. The “template” modifier allows you to specify a custom template suffix.
Merge Tag | Template |
---|---|
{all_fields:template[custom]} | /gravity-forms/all-fields-{template}.php /gravity-forms/all-fields-custom.php |
No Template
You may want to create a generic template that applies to all instances of the merge tag by default and then disable that template to use the default Gravity Forms merge tag output in a few specific instances.
Merge Tag | Template |
---|---|
{all_fields:notemplate} | No template |
Hide Pricing Fields
Hide pricing fields (i.e. order summary) from the {all_fields}
output.
Merge Tag | Template |
---|---|
{all_fields:nopricingfields} | Hide pricing fields |
Field Filtering Modifier
These modifiers allow you to control which fields are output in the {all_fields}
merge tag without having to touch any code.
Please note: you only need the plugin installed to use these modifiers. You do not need to install the template files in your theme.
Merge Tag | Description |
---|---|
{all_fields:include[1,2]} | Include a field that is not included by default (i.e. HTML fields). |
{all_fields:exclude[3,4]} | Exclude a field that is included by default. |
{all_fields:filter[1,2]} | Only include the specified field IDs. This takes precedence over both the ‘include’ and ‘exclude’ modifiers. |
{all_fields:include[1,2],exclude[3]} | The :include and :exclude modifiers can be combined. |
GF Nested Forms Support
To filter which fields from a child form display in your {all_fields}
merge tag you can use the :filter modifier and the [Nested Form Field ID].[Child Field ID] format (e.g., 4.3; where 4 is the Nested Form field ID and 3 is the child field ID from the child form).
You can use the :include, :exclude, :filter, and :index modifiers on the Nested Form field to filter which child fields should be displayed.
Merge Tag | Description |
---|---|
{all_fields:filter[1,2,3.4,3.5]} | In this example, 1 and 2 are field IDs on the parent form. 3 is the Nested Form Field ID and 4 and 5 are field IDs on the child form. |
{all_fields:exclude[3.4,3.5]} | In this example, 3 is the Nested Form field ID and 4 and 5 are field IDs on the child form. |
{Nested Form:1:filter[4,5]} | Show fields 4 and 5 from the child form for this Nested Form field. |
{Nested Form:1:index[0],filter[1]} | Show field 1 in the first child entry from the child form. :index must be paired with :filter. |
{Nested Form:1:index[-1],filter[1]}
to target the last entry and display the value from field 1.Excluding Specific Inputs Within a Field
Fields that contain multiple inputs, such as the Name field, can be excluded per-input by specifying the input ID. For example, to exclude the First Name, add .3
to the Field ID (e.g., 5.3; where 5 is the Name field).
This works for any field that contains multiple inputs, such as Name, Address, and Product. You can find the specific input IDs in Gravity Forms Documentation for Name and Address fields.
Merge Tag | Description |
---|---|
{all_fields:exclude[5.3]} | In this example, 5 is the field ID of a Name field. 3 is the First Name input ID. |
Filter and Exclude Via Custom Function
Custom functions can be used to identify fields for filtering. Using a custom modifier, the function should return an array of field IDs. For example, if you want to exclude fields with personal information from some instances of the {all_fields}
merge tag, you could specify a custom modifier value like so:
{all_fields:exclude[persInfoFields]}
And then create a custom function to identify the IDs of those fields.
add_filter( 'gwaft_modifier_value_persInfoFields', function() {
return array( 1, 2, 3 );
} );
Merge Tag | Description |
---|---|
{all_fields:exclude[customFunction]} | Exclude fields that are returned via customFunction. |
{all_fields:filter[customFunction]} | Show fields that are returned via customFunction. |
This is useful in circumstances when you need to use the {all_fields}
merge tag in multiple places and want to exclude the same fields in several contexts. Instead of having to copy the same string of field IDs to every place you’ve inserted the {all_fields}
merge tag, you can specify the custom function once and use the custom filter wherever you need it. If you want change or add to the excluded fields in the future, you simply update the custom filter and it will be applied everywhere the filter is used.
Customizing the Template
Ok, don’t let this section intimidate you. Here’s the TLDR; Loop through $items
, use $item['label']
for the field label, and $item['value']
for the field value. Here’s the simplest template you could have:
<ul>
<?php foreach( $items as $item ): ?>
<li>
<strong><?php echo $item['label']; ?><strong><br>
<?php echo $item['value']; ?>
</li>
<?php endforeach; ?>
</ul>
You’ll most likely want to use the sample template above as a starting point though as it takes care of a requirements to better align the template with Gravity Forms default All Fields functionality.
Digging Deeper
The {all_fields}
template works like any other WordPress template with one exception. There is a special $items
array available to you.
Each $item
contains a label, value, and field property. The label and value are the exact label and value that the default {all_fields}
merge tag would output. The field is the input-type-specific GF_Field object for the current field. This is useful when you want to alter the way a field is displayed depending on the field you’re working with.
Lastly, you have access to the current entry via the $entry
variable and the current form via the $form
variable. For more details on these variables, see the parameters section below.
Parameters
$items array
An array of items, each item containing the Gravity-Forms-formatted field label, field value and field object for the given field. The field label and field value are the same values that Gravity Forms outputs in the default
{all_fields}
merge tag.$entry Entry Object
The current Gravity Forms Entry object.
$form Form Object
The current Gravity Forms Form object.
Doing more with Gravity Forms
Okay, so with this plugin you can easily handle {all_fields}
data. But what if you just don’t feel you’ve got enough different fields in your Gravity Forms? What if you want to export more fields? That’s where Gravity Perks comes in. Gravity Perks is an essential bundle of 34+ WordPress plugins that add new features for Gravity Forms. Plugins such as…
GP eCommerce Fields
With the GF eCommerce Fields plugin you can easily add eCommerce field types to your Gravity Forms. The new pricing fields include Discount, Tax, and Subtotal. This plugin also improves upon the functionality of Gravity Forms’ Coupons and Shipping fields.
GF eCommerce also adds support for special merge tags for including the subtotal, coupon and conditional-logic-based discount amounts in calculation-enabled fields along with a handy merge tag for displaying the order summary in your confirmations and notifications.
It’s great for helping your users better understand their orders by showing the subtotal before shipping, coupons and taxes have been applied – avoiding any nasty surprises at checkout!
GP Easy Passthrough
Easy Passthrough simplifies transferring entry data from one Gravity Forms form to another. Instead of spending time setting up dynamic parameter names and customizing confirmation query strings, you can passthrough data by setting up an Easy Passthrough configuration.
Entry data is transferred across multiple sessions using the special Easy Passthrough token. This token is a secret key, unique to each entry, preventing random users from guessing at the token and passing through entries they should not have access to.
GP Post Content Merge Tags
This plugin allows you to include Gravity Forms merge tags in WordPress post content, allowing you to, for example
- Implement persistent confirmation pages. For example, you could send the user an email including the confirmation page URL to their form submission, which they could save for future reference.
- Reuse the same confirmation page for multiple forms. For instance, you might have 25 forms on your site but would like to redirect users from all of those forms to a single, personalized “Thank You” page on submission.
- Reclaim complete control over the styling of the redirect page while maintaining the ability to use Gravity Forms merge tags in the content of the page.
These are just 3 of the 34+ plugins in the Gravity Perks collection. Check out the full set of plugins and see what Gravity Perks can do for you today!
FAQs
How do I hide Hidden fields from the {all_fields} merge tag?
You can use the :nohidden
merge tag modifier on the merge tag like this:
{all_fields:nohidden}
:nohidden
hides field output of fields using the Hidden field type. It doesn’t affect to fields set to a Visibility of Hidden.How can I translate the Order Summary label?
You can set a custom Order Summary label using the gwaft_order_summary_label
filter.
add_filter( 'gwaft_order_summary_label', function() {
return 'My Custom Order Summary Label';
} );
Hooks
Questions? Feedback?
What questions do you have? What features are missing? We’d like to make this into a more robust plugin and your feedback will be a big part of shaping the final product.
Did this resource help you do something awesome with Gravity Forms?
Then you'll absolutely love Gravity Perks; a suite of 47+ essential add-ons for Gravity Forms with support you can count on.
Hello
Firstly thanks for the plugin. I followed steps 1-3 (but didn’t edit the template) just left it as is
However, it still only outputs the basic form fields (not all the HTML) in notifications. Am I a dummy?
Hello Peter, This is a bit of a strange one as the include should cover all fields including the HTML. Please note that you do not have to upload the theme and only have the plugin installed for this to work. Go ahead and try just having the plugin and the shortcode. Let us know the results.
Is it possible to get the dynamic confimation text of a child form merged to the confirmation text of the parent form?
Hi Konstantin,
The All Fields template supports Nested Forms in all places the merge tag can be used, which includes Confirmation pages. If you have further questions, drop us a line in support and we’ll be happy to help!
Are shortcodes supported in the HTML fields in terms of sending their rendered data to the notification? I am working with one specific shortcode that renders fine in the HTML block on the page, but when I send the notification, it comes across as “no data found” which is an error message related to that shortcode…
I have also used the gform_pre_render function to add content to the HTML field, and the notification doesn’t recognize the data sent by the pre render function either.
Hi Cameron
I’ve replied to your question via email so that you can send us an export of the form.
Best,
Hi Ryan, I am using this plugin to create multiple nested forms in gravity form. I need to send all the form data including nested forms[ If the user filled multiple times ] to Salesforce using API. How I am able to get all nested form data in the gform_pre_submission function? Please help me Here is the form link:
Hello Atul, Thanks for reaching out. This looks like it will need a deeper dive to fully understand. If you have a Gravity Perks account, could you please reach out to us via our support channel found here and we would be more than happy to help you out with this one.
Hi, I have installed your plugin to work alongside gravity forms.
I have a number of HTML fields on my form, inside these I generate a table for a user to enter data into.
I have managed to use your plugin to show the tables in the email notification sent to the business, however, the user entered data does not show on the email and I cannot find it stored on the entries.
How can I push the data they enter in the table into my email notification?
Thanks, Dexy
Hey Dexy, You can add this code to your functions.php file and the modifier added to their {all_fields:allowHtmlFields} should now include all HTML fields by default. Please not that this does not require the All Fields Template to function unless you need the All Fields Template for something specific. So please give this a try and let us know if this would work out for you.
How to show gravity form nested form field (summary only ) as table layout in a gravity pdf template?
Hi Sheikh,
GravityPDF has an article on how to display the Nested Forms table within GravityPDF. Please check it out here: https://docs.gravitypdf.com/v5/how-to-display-the-nested-forms-table-shown-prior-to-v5-1/
Best,
I’m looking for a way to hide just the prices in the notification email without hiding the order items. I thought the {all_fields:nopricingfields} might do that but it hides the entire order section.
The prices will be displayed at some point in the future and we need to hide them for now – a custom quote will be generated by the sales person.
Any guidance is appreciated.
Hi Dann,
This isn’t supported in the All Fields Template, however GF eCommerce Fields supports outputting custom markup for the order summary using this hook. Use the examples as a starting point and customize as needed.
What I’m trying to do is to show all HTML fields when using {all_fields} in a notification email to the administrator.
I still can’t figure out how to do that.
I’ve seen this part:
{all_fields:include[1,2]} Include a field that is not included by default (i.e. HTML fields).
Isn’t there a way to just include ALL FIELDS without having to list all of the fields that normally don’t show up?
I would have to list about 100 fields!!
That’s really what I’m looking for… just show ALL FIELDS.
Hello, That is a bit of a strange one as using the {all_fields:include[1,2]}. This should include a field that is not included by default like your HTML fields. Of course, you could take it a step further and customize the template fully by downloading the templating files and saving them to your root folder, then customizing them to meet your needs. Do you currently have a Gravity Perks license? If so we would be more than happy to take a deeper dive into this for you. Please reach out through our support channel here.
I have a conditional logic HTML that shows an image.
I use include tag but the image is not included in the notifications using this.
Any help will be appreciated .
Thanks .
HTML fields are display only fields. They aren’t saved in the Form Entry, so they won’t display when using the {all_fields} merge tag.
https://docs.gravityforms.com/html/#merge-tags
The exclude modifier does not work on individual pricing fields. It seems to can exclude ALL pricing fields but not single ones. i was using a pricing field to do a calculation for a another field, I just switched that to a number field instead. Not sure if this is a bug or the way it works out of the box. Cheers, great plugin!
Hello Shonari, Are you selecting the single pricing fields like this {all_fields:exclude[3,4]} and it is excluding all pricing fields or how are you using the exclude merge tag? Let us know so we could help you out with this one. 😀
hi! I am wondering if this plugin may sort my problem. I’ve installed Gravity Forms & the Product Addon for Gravity Forms for Woocommerce.
It’s working great with some custom code that populates a single text box (hidden with css not using the “hidden” tag on the form because that didn’t allow the form to populate!). The value of the box then shows/hides various parts of the form appropriately.
(customer chooses a product variant – one of four choices – the box is then is populated with 1,2,3, or 4, depending on the variant chosen.
2 of the options have further choices for customers to make, 2 don’t. This is working brilliantly.
Except in the order emails. Which are now the ONLY place (oh and on the pdf invoice) that this hidden box appears.. So the order emails both to the customer and to myself include “product variable: 4” which I’m fine with, but might be confusing to a customer.
I’ve downloaded the plugin, installed the template, but I must admit I’m struggling with exactly what to do next. There are multiple forms, so the box that needs to be hidden isn’t the same ID in each form, so it won’t work as a global “exclude” – that’s my first concern. My second is simpler – I just don’t know how to do it. I’m wondering if you can explain it more simply to a non-developer (although I’m pretty good at picking things up!)
Cheers Sarah
Hi Sarah,
The all_field merge tag will be inserted in the notifications setting message box, and in your case, you’ll need to use the Exclude modifier to hide the textbox field you don’t want the users to see. The merge tag will be written in this format {all_fields:exclude[4,5]}, where 4 and 5 will be the IDs of the fields you want to hide. You mentioned multiple forms, I’m not sure how you’re using the multiple forms together but if each form will send individual notifications, then you just have to insert the merge tag with the exclude modifier inside their notifications settings message box and edit the field ID to match the ID for that form.
In case this doesn’t work for you, then we’ll need a close-up look into your form set up to get a better understanding of your request. If you’re a Gravity Perks Subscriber you can send a message via the support form so we can assist you further.
Best,
Hi, where can I find the snipet to insert in the fuction.php file? I installed the plugin indicated, inserted in the all-fields.php theme file, but the snipet is missing as you indicated. Thank you
Hello Piero, Great question. You would have to install the plugin, Download the sample template directory/file. Add the folder to your active theme’s root directory found here:/wp-content/themes/{your-theme}/. Then you would just have to customize the template. No need for an extra snippet, just enter the customized template into your theme folder and you should be good to go!
{all_fields:include[1,2]} for the HTML part are we suppose to the change the 1 and 2 and if so with what?
Hi Jen,
1 and 2 are the IDs of the fields you want to include to the form summary, so you will replace it with the IDs of those fields.
Best,
I have 3 fields in my contact form. First field ( Name = {Name:1} ), Second field ( Email = {Email:2} ), Third field ( Message = {Message:3} ).
I ready the Hide Pricing Fields section. when I try to hide my email field then I failed. this section was telling when I use {all_fields:nopricingfields} this will hide pricing field. but I am trying to hide my email field. then how syntax will be for the email field. from yesterday, I am trying to fix it. kindly tell me the correct syntax.
Hi Zubair,
Could you give this merge tag {all_fields:nopricingfields,exclude[2]} a try and see if it works for you? 2 is the ID of the Email field.
I hope this helps.
Best,
HI there. I the code you can put an Isset to avoid error´s.
Like this “if( isset($_modifiers[‘filter’]) ) {…”.
Best Regards.
Hello João, The usage of an Isset should work just fine.
Hi there,
Can i achive the following?
What i’d like is to align my nested form entries in the client notification as seen in image 2 – at the moment the client notification shows as image 1
image 1: https://siteforms.ie/wp-content/uploads/2020/07/1.jpg image 2: https://siteforms.ie/wp-content/uploads/2020/07/2.jpg
any help would be much appreciated
regards
Tom
Hi Thomas, We have a snippet that will output the Nested Form Field as a table in Notifications which is similar to image 2. You can use it with the All Fields Template, however, it doesn’t require it. I hope this helps.
Best,
Hi Samual,
thanks for that, I’ve created a new template called all-fields-custom.php and have added the snippet, but all i get back in the notification is blank.
In the notification section i’ve added this {all_fields:template[custom]}
i’m obviously missing something here?
regards
Tom
Hi Thomas,
You have to insert the snippet in your theme’s fucntion.php file and use the {all_fields} merge tag. Please refer to our article on snippet troubleshooting for details on installing our snippets.
https://gravitywiz.com/documentation/snippet-troubleshooting/
Best,
Working now and exactly what i needed – very much appricate the help there Samuel
regards
tom
Hi Guys! Thanks for your awesomeness. This is a great plugin but I am not sure if it will do exactly what is required for a current project. We have a fitness centre that services drop ins and members. Drop s ins have to pay while members do not. In GF everything has been created beautifully except {all_fields} which I love the style of. Is it possible to do the following…
Non- Members outputs perfectly as is using {all_fields} Members would output exactly the same WITHOUT any pricing visible.
I’ve tried this a couple ways now using this plugin but cannot quite reach my goal. Essentially what I am trying to do is maintain the table style for both outputs but remove prices (not product details) from the “Members” confirmation & notification only.
Thanks in Advance for any wisdom,
-R
This is working like a charm for us when used on a form submit preview page… in default (english) language. However, when filling out a translated form (we use WPML), the preview is all in english.
How do we get the translated field labels to show?
Hello Regs, what labels are you attempting to translate? Also, have you tried using the string translations plugin with WPML?
Hi Ryan,
The fields are already translated. Issue is that the translated fields do not show when viewing on a non-english form preview page
{all_fields:nohiddenvisibility}
I second Laurent’s inquiry. It would be a great feature if descriptions could be included in the shortcode. Thanks for all you do!
Hello Wil, This is a great request. The GF_Field label does include a “Description” field object string that can be displayed on the all fields tag. With that being said, are you only attempting to show the description of a specific field or are you trying to add it to the All Fields template?
Hi David,
Is it possible to target/include a field description?
Eg. I have field 34 that is a product option. I would like to include its description. Something like {all_fields:include[34:Description]} ?
Thanks, Laurent
Hello Laurent, thanks for writing in. Sadly that merge tag would not work in this case. You could customize the template and include the GF_Field label. This does include a “Description” field object string that can be displayed on the all fields tag. 😃