Replace field merge tags in administrative field’s default value
Advanced Merge Tags has a feature that allows replacement of field merge tags in the for text fields that have Administrative visibility after submission of the form.
This feature can be activated in the global plugin settings:

By default this works for Text fields only. The field merge tags should be added to the default value and the visibility should be administrative:

Modify the supported field types
The gwp_amt_replace_admin_field_variables
filter allows to modify the list of field types
The filter has the following parameters:
$field_types
(array): an array of field types that should have field merge tags replaced before being saved to the database. By default, it only includes thetext
field type.$value
(string): the input value of the field.$lead
(array): the current entry object.$field
(GF_Field): the current field object.$form
(array): the current form object.
Developers can use this filter to add or remove field types from the $field_types
array.
For example, you could add this snippet to your theme’s functions.php to add the textarea
field type to the list of field types that should have field merge tags replaced before being saved to the database:
add_filter( 'gwp_amt_replace_admin_field_variables', function( $field_types, $value, $lead, $field, $form ) {
$field_types[] = 'textarea';
return $field_types;
}, 10, 5 );
Frequently Asked Questions
To dynamically populate a hidden text field using values from other fields, you can enable the “Replace field merge tags in Administrative Text fields” setting in GravityWP Advanced Merge Tags. Once this is toggled on, any merge tags (like {field:1}) inside an administrative Single Line Text field’s default value will be replaced with actual values right after submission and before saving the entry.
// Example setup:- Field 1 (User Name): visible input
- Field 2 (Internal Note): admin-only text field with default value {field:1}
// Result:
If the user enters “Jon Alexander”, the Internal Note field will store: Jon Alexander
By default, this feature only supports Single Line Text fields. These are ideal for simple string data that don’t require complex formatting or serialization. However, developers can extend support to other field types like Textarea using a filter hook.// Add Textarea field support (functions.php):
add_filter( 'gwp_amt_replace_admin_field_variables', function( $field_types ) {
$field_types[] = 'textarea';
return $field_types;
}, 10, 5 );
Yes. This functionality only applies to fields marked as Administrative in the Gravity Forms field settings. Merge tag replacement does not occur on Visible or Hidden fields unless they are also administrative.Go to Field Settings → Advanced → Set “Visibility” to “Administrative”
The merge tags are processed and replaced at the time of form submission not when the form is rendered. This means the field stores the resolved value after all other inputs are captured.Default Value: {field:1}
User enters: Jon Alexander
→ On submit, {field:1} resolves to “Jon Alexander”
→ Saved in the admin field as plain text
This allows internal fields to store context-specific information, like a user’s name or timestamp, without showing that field to the user. It’s great for tracking, reporting, tagging, or triggering automation based on entry metadata.Example: Save {user:user_email} into an admin-only text field for reference.
Last updated: 22-07-2025