☰
Documentation

Add-on: Advanced Merge Tags

The Advanced Merge Tags Add-On for Gravity Forms adds extra Merge Tag modifiers (and a lot of power) to your Forms. From the most common used functions like capitalize and trim to changing date formats and encrypting or retrieving information.

Advanced Merge Tags adds two kinds of tools:

  • Modifiers change the value of a field merge tag. Add them after the field ID, with their options: {Name:1:gwp_case to=upper}.
  • Merge tags produce a value of their own, like the current date or a value from another form: {gwp_now format="d-m-Y"}.

Both work wherever Gravity Forms replaces merge tags, like notifications, confirmations, GravityView and Gravity Flow. Modifiers on field values and merge tags that read the entry need a submitted entry; merge tags like gwp_now, gwp_url and gwp_user also work in default values and HTML fields.

Modifiers

Text

ModifierWhat it does
gwp_caseChange to uppercase, lowercase, first letter uppercase or lowercase, or capitalize every word.
gwp_appendAdd text before and after the value, only when the value is not empty.
gwp_replaceSearch and replace text, case sensitive or not.
gwp_substringReturn part of the value; also works in calculations.
gwp_reverseReverse the characters.
gwp_remove_accentsReplace accented characters with plain letters.
gwp_sanitizeClean up the value: strip tags, trim, make a slug or a positive integer.
gwp_censorMask the words in the WordPress disallowed words list.
gwp_lengthCount the characters.
gwp_word_countCount the words; also works in calculations.

Dates

ModifierWhat it does
gwp_date_formatFormat a date, shift it (like +3 weekdays) and convert it to another timezone.

Values from other forms

ModifierWhat it does
gwp_get_matched_entry_valueGet one value from a matching entry in another form. Also a merge tag.
gwp_get_matched_entries_valuesShow values of all matching entries as a list or HTML table.
gwp_count_matched_entriesCount the matching entries. Also a merge tag.
gwp_sum_matched_entries_valuesAdd up a number field of the matching entries.

These modifiers share the options for filtering and sorting matched entries, and read entry values only when the Entry access settings of the other form allow it.

Encoding, encryption and data

ModifierWhat it does
gwp_urlencodeURL-encode the value for a link, also for Checkbox and List fields.
gwp_urldecodeDecode a URL-encoded value.
gwp_encryptEncrypt the value into a URL-safe string.
gwp_decryptDecrypt a value made with gwp_encrypt.
gwp_hashHash the value with an algorithm like sha256 and an optional salt.
gwp_json_getRead one value from a JSON string.
gwp_user_roleShow the roles of the WordPress user whose login, email or ID is in the field.

Merge tags

Merge tagWhat it returns
gwp_nowThe current date and time, formatted and shifted as you like.
gwp_current_timestampThe current Unix timestamp.
gwp_date_createdThe date the entry was created, formatted and shifted.
gwp_date_updatedThe date the entry was last updated, formatted and shifted.
gwp_date_fieldDeprecated: a formatted date from a field. Use gwp_date_format instead.
gwp_entryA property of the current entry, like its ID or status, with modifiers.
gwp_eeidA value of the entry whose encrypted ID is in the URL.
gwp_userA property of the logged-in user, with modifiers.
gwp_urlThe current URL, the site or home URL, or part of the URL.
gwp_parent_slugThe slug of the parent page, or of a higher ancestor.
gwp_post_idThe post ID of a URL on your site.
gwp_generate_tokenA random token, optionally unique.
gwp_calculateThe result of a formula, rounded and formatted as a number or currency.
gwp_get_matched_entry_valueOne value from an entry in another form that matches a fixed value.
gwp_count_matched_entriesThe number of entries in another form that match a fixed value.
gwp_gview_advanced_filterGravityView filter conditions from the current user’s data (needs GravityKit Advanced Filters).

Combine and nest

Settings and integrations

Advanced Merge Tags in GP Populate Anything templates

Use Advanced Merge Tags modifiers and entry merge tags like gwp_date_created in the Custom Value templates of GP Populate Anything when you populate from Gravity Forms entries.

Advanced Merge Tags settings

All settings of GravityWP Advanced Merge Tags: replacing merge tags in administrative fields and post content, error messages, entry access per form or field, and the gwp_user_role permission.

Combine regular with advanced modifiers

Combine modifiers like :value with advanced merge tag modifiers.

Filter and sort matched entries

How to add search filters (filter1, operator1, value1) and sorting (sort_by, sort_order, offset) to the Advanced Merge Tags modifiers that read entries from another form.

Modifier

gwp_append

Append text before and/or after the field value if the value is not empty.

Merge Tag

gwp_calculate

The gwp_calculate Merge Tag returns the result of a calculation formula and formats the number as specified.

Modifier

gwp_case

Change value to uppercase, lowercase, first character uppercase or lowercase, or uppercase all the words

Modifier

gwp_censor

The gwp_censor Merge Tag modifier censors blacklisted words in a string using either a specified character or a fixed-length string.

Merge Tag

gwp_count_matched_entries

This modifier can be used to count entries from another form, based on a shared value with optional extra filters.

Merge Tag

gwp_current_timestamp

Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

Merge Tag

gwp_date_created

Returns a modified date time relative to the date time when the entry was created in the desired format.

gwp_date_field

Returns a modified date time relative to the date time of a field-value with a date/time string in the desired format.

Modifier

gwp_date_format

Returns a modified date time relative to the date time of a field-value with a date/time string in the desired format.

Merge Tag

gwp_date_updated

Returns a modified date time relative to the date time when the entry was last updated in the desired format.

Modifier

gwp_decrypt

Decrypt values that were encrypted using gwp_encrypt.

Merge Tag

gwp_eeid

Enables the retrieval of entry properties using the encrypted entry ID (eeid) URL parameter. Intended for use on pages/posts/confirmation messages that are displayed in the browser.

Modifier

gwp_encrypt

Encrypt entry ids or entry field values using OpenSSL encryption.

Merge Tag

gwp_entry

Returns a property or field value of the current Gravity Forms entry, like the entry ID or creation date, and lets you apply advanced modifiers to it.

Merge Tag

gwp_generate_token

Generate a random token with customizable attributes like length and character set

Modifier

gwp_get_matched_entries_values

Gets styled multiple values from matched active entries.

Merge Tag

gwp_get_matched_entry_value

Retrieve values from entries from another form, based on a shared value.

Merge Tag

gwp_gview_advanced_filter

The gwp_gview_advanced_filter merge tag is designed to dynamically filter entries in GravityViews, leveraging user meta properties that store JSON-encoded arrays of filter values.

Modifier

gwp_hash

The `gwp_hash` modifier can be used to generate a hash of a field value with a specified algorithm and an optional salt. This can be useful for comparing data while hiding the actual value.

Modifier

gwp_json_get

The gwp_json_get modifier is extracts values from a JSON string stored in a Gravity Forms Field.

Modifier

gwp_length

Count the number of characters.

Merge Tag

gwp_now

Returns the currrent date and / or time or a modified and formatted date / time relative to the current date / time.

Merge Tag

gwp_parent_slug

Returns the slug of one of the parent posts of the current post and let's you pick the depth of ancestor you need.

Merge Tag

gwp_post_id

Returns the post-id for a certain url.

Modifier

gwp_remove_accents

Converts all accent characters to ASCII characters.

Modifier

gwp_replace

Search and replace field values

Modifier

gwp_reverse

Reverses a text string.

Modifier

gwp_sanitize

The gwp_sanitize modifier allows you to display sanitized or trimmed values

Modifier

gwp_substring

Retun a substring (part of) the original value and specify where the substring starts and what is the length.

Modifier

gwp_sum_matched_entries_values

The gwp_sum_matched_entries Modifier can be used to calculate the sum of a field value in multiple entries from another form, based on a shared value with optional extra filters.

Merge Tag

gwp_url

Returns the WordPress site url, the WordPress home url, the current url, or an element of the current url.

Modifier

gwp_urldecode

The gwp_urldecode can be used to decode url encoded values.

Modifier

gwp_urlencode

URL encode the field value to pass it as an url parameter for dynamic population.

Merge Tag

gwp_user

Allows the dynamic retrieval of user information based on the current logged-in user's properties.

Modifier

gwp_user_role

Retrieve and display user roles based on a field value with the user's login, email, or ID

Modifier

gwp_word_count

Counts the number of words in a string value.

Nested Merge Tags

How to use Merge Tag values inside Advanced Merge Tags and Modifiers.

Nested Modifiers

Use multiple, nested modifiers to perform different actions on the Merge Tag value.

Relative Date Formats in Gravity Forms (gwp_date_format, gwp_date_created, gwp_date_updated)

The Gravity Forms relative date feature in gwp_date_format lets you shift dates with the modify parameter. Use expressions like “+1 week” or “next Monday” and combine with merge tags such as gwp_date_created and gwp_date_updated to display dynamic, timezone-aware dates in confirmations and pages.

Replace field merge tags in administrative field's default value

Allows replacement of field merge tags in a text field's value after submission of the form.

Proudly powered by WordPress