gwp_urlencode
With the gwp_urlencode Merge Tag Modifier for Gravity Forms you can encode the field value with the purpose to pass it as an url parameter for dynamic population. List field values are also supported, provided the values do not contain row/column separator characters like , or |.
:gwp_urlencode
Encoding values of special fields
gwp_urlencode supports creating url parameters for List Fields and Checkbox Fields. It might not support other special fields with complex values. Please let us know by raising a support question and we will add it for you.
Examples
If you want to use this Modifier, just place is after the Field ID in the Merge Tag, like this:
{Text:1:gwp_urlencode}
Example | Modifier |
---|---|
info@gravitywp.com | info%40gravitywp.com |
“Quotes” and spaces | %22Quotes%22%20and%20spaces |
1,2;3:4 | 1%2C2%3B3%3A4 |
Frequently Asked Questions
The :gwp_urlencode modifier converts special characters into a URL-safe format, making your form data safe to use in query strings and dynamic population URLs. It works by applying PHP’s urlencode() function to the field value, ensuring spaces, symbols, and punctuation are correctly encoded. This modifier is especially helpful when building custom redirects, populating fields via URL, or sending data to APIs that expect encoded input.{Email:1:gwp_urlencode}
This modifier works on standard fields like Single Line Text and Paragraph Text, and it also supports complex fields such as Checkbox and List. For checkbox fields, it joins checked values with commas before encoding. For list fields, it joins column values with | and then rows with commas then URL-encodes the entire string.{Options:3:gwp_urlencode}
{Items:4:gwp_urlencode}
Use :gwp_urlencode when you need to pass form values through URLs—like in redirect query strings, confirmation messages, or dynamic field population on another form. Encoding prevents issues caused by special characters like @, &, or spaces, which could break your URLs if left unencoded.https://example.com/?email={Email:1:gwp_urlencode}&items={Items:4:gwp_urlencode}
Yes. For checkboxes, it encodes selected values after joining them with commas. For list fields, it processes multi-column rows by joining columns with |, rows with ,, then encoding the whole result. Our test with two list rows (Item A | 2, Item B | 5) correctly produced:Item%20A%7C2%2CItem%20B%7C5
No, it doesn’t. This modifier is straightforward—you just add :gwp_urlencode to your merge tag. There are no extra options or configuration needed.{Field Label:Field ID:gwp_urlencode}
Last updated: 22-07-2025