gwp_append
With the gwp_append Merge Tag Modifier for Gravity Forms you can append a string before and/or after the field value, but only if the field value is not empty.
:gwp_append before="" after=""
If you want to change the output of a Merge Tag text, use the Modifier like this:
Example | Modifier | Output | Info |
---|---|---|---|
{Example:1} | WP | Value of the field is ‘WP’ | |
{Example:1:gwp_append before="Gravity" after=" is great"} | :gwp_append before="Gravity" after=" is great" | GravityWP is great | Modifier adds ‘Gravity’ before and ‘ is great’ after the value ‘WP’ |
{Example:2} (empty field value) | Value is empty | ||
{Example:2:gwp_append before="Gravity" after=" is great"} | :gwp_append before="Gravity" after=" is great" | Modifier doesn’t append, because the value is empty |
Try the demo
Check also the tutorial Append text before or after Gravity Forms Merge Tag if not empty.
Frequently Asked Questions about gwp_append
What does the gwp_append modifier do?
The gwp_append modifier allows you to add custom text before and/or after the value of a field in Gravity Forms. This text will only appear if the field has a value. If the field is empty, no output is shown.
You can use this modifier in confirmation messages, notification emails, or any other place where merge tags are supported.
Example:
{First Name:1:gwp_append before="Hello " after=", welcome!"}
If the user enters:
JonThe output will be:
Hello Jon, welcome!What happens if the field is empty?
If the field is empty, gwp_append does not display anything — neither the before nor after text will be shown.
Example:
{Company:2:gwp_append before="Company: " after=" Ltd."}
If Company is empty → no output.
Can I use only before or only after?
Yes, you can use only before=”…”, only after=”…”, or both together.
Example — only after:
{Age:3:gwp_append after=" years old"}
If user enters 25 → shows:
25 years oldCan I use special characters or emojis with gwp_append?
Yes. You can include special characters, punctuation, or emojis in the before or after text.
Example:
{Name:1:gwp_append before="🎉 " after=" is awesome! 🚀"}
If user enters Jon → shows:
🎉 Jon is awesome! 🚀Where can I use gwp_append?
You can use it in any part of Gravity Forms that supports merge tags, such as:
- Confirmation messages
- Notification emails
- HTML fields in forms or pages
- GravityView templates (if merge tags are supported there)
Example in a confirmation message:
{First Name:1:gwp_append before="Hello " after=", welcome to our site!"}
First Name = Field label
1 = Field ID
gwp_append = merge tag modifier
Last updated: 03-07-2025