Skip to main content

Modifier: :urlencode

URL-encode the value. Write it after a colon: {Email:3:urlencode}

About

Escapes the value so it is safe inside a query string.

ProductGravity Forms
RequiresGravity Forms 1.9 or later
Works onform fields
In the pickerChange the output

How to use it

Pass a value in a link

Spaces become +, and characters like @ and & are encoded so the link keeps working.

Write

https://example.com/search?email={Contact Email:5:urlencode}&name={Full Name:1:urlencode}

Get

https://example.com/search?email=ada%40example.com&name=ada+Lovelace

Examples

Rendered by real Gravity Forms and GravityKit PHP against a test entry.

Merge tagOutputWithout the modifier
{Contact Email:5:urlencode}ada%40example.com[email protected]

Where the merge tag picker offers it

Form fields: Single line text · Paragraph text · Email · Website · Hidden · Consent · Signature · Drop down · Radio buttons · Checkboxes · Checkboxes, one choice · Multi select · Image choice · Multiple choice · Post category · Number · Calculation · Product · Product (single) · Product (hidden) · Product price · Quantity · Option · Shipping · Shipping (single) · Total · Date, after a custom format · Time · Name · Name, one part · Address · Address, one part · Phone, standard format · File upload · Post image · List · Repeater.

Where it is left out

Field kindsWhy
DateNeeds a date format first. GravityView changes the stored date (2024-03-09), which has no letters. Add “Custom date format” or “Human-readable time difference” first.
Phone, international formatWorks on the stored record. An international phone field stores a record like {"country":"US",…}. GravityView would change that record, not the number people see.