gwp_user
The gwp_user
merge tag allows for the dynamic retrieval of user information based on the current user’s properties.
Functionality
This merge tag can extract various user properties, such as username, email, and more, directly into your forms or notifications. It ensures sensitive information, like passwords, is handled securely by preventing such data from being displayed.
It is similar to the Gravity Forms {user} merge tag, but {gwp_user} allows using additional merge tag modifiers, making it more powerful.
Usage
To use the gwp_user
merge tag, specify the desired user property in the tag itself, followed by any modifiers if needed. The basic syntax is as follows:
{gwp_user:property}
Where property
is the user attribute you wish to display.
Supported User Properties
User Property | Mergetag |
---|---|
User ID | {gwp_user:ID} |
User login | {gwp_user:user_login} |
User email | {gwp_user:user_email} |
Display name | {gwp_user:display_name} |
First name | {gwp_user:first_name} |
Last name | {gwp_user:last_name} |
Custom Property | {gwp_user:custom_property} |
Modifiers
Modifiers can be appended to further manipulate the output, such as sanitizing text or changing the format. These are specified after the property, separated by a colon:
{gwp_user:property:modifier}
We’ll give you a few examples how to use it with Advanced Merge Tags modifiers.
Output | gwp_user merge tag and modifier example |
---|---|
First name in all capitals using the gwp_case modifier | {gwp_user:first_name:gwp_case to=upper} |
Counting all the Gravity Forms entries with the users e-mailaddress in a field with gwp_count_matched_entries, for example count all entries in Form ID 5 where Field ID 2 is the user e-mail. | {gwp_user:user_email:gwp_count_matched_entries form_id=5 match_id=2} |
Sanitize the User Display Name with the gwp_sanitize modifier | {gwp_user:display_name:gwp_sanitize type="sanitize_text_field"} |
URL Encode the users Display Name with gwp_urlencode | {gwp_user:display_name:gwp_urlencode} |
Getting a value from an Entry with matching e-mailaddresses with gwp_get_matched_entry_value, for example give me back the value of Field ID 10 in Form ID 5 where the user e-mail is in matching Field ID 2 | {gwp_user:user_email:gwp_get_matched_entry_value form_id=5 match_id=2 return_id=10} |
Frequently Asked Questions
The {gwp_user} merge tag pulls user-specific information from the currently logged-in WordPress user. It can dynamically output data like user ID, email, display name, and more directly inside your form confirmations, notifications, or HTML blocks. Unlike the native {user} tag from Gravity Forms, {gwp_user} supports powerful modifiers like string transformation, substring extraction, or even entry lookups.
Example:{gwp_user:user_email}
You can display common user profile fields such as user ID, username, email, display name, first name, and last name. If custom user meta fields are registered, you can retrieve those as well using {gwp_user:your_custom_field}.
Example:{gwp_user:first_name}
Yes, absolutely. That’s what makes {gwp_user} so powerful. You can chain it with modifiers like gwp_case (to change text case), gwp_length (to count characters), gwp_substring (to extract part of a string), and more. This gives you full control over how the data appears.
Example:{gwp_user:display_name:gwp_case to=upper}
Yes! Combine {gwp_user} with the gwp_count_matched_entries modifier to count how many Gravity Forms entries match the user’s email or ID. This is useful for user-specific stats, like how many submissions a user has made.
Example:{gwp_user:user_email:gwp_count_matched_entries form_id=5 match_id=2}
Yes. The plugin will never expose sensitive data like passwords. If you accidentally try to use {gwp_user:user_pass}, it will return an empty string or an error message depending on your settings. Only safe-to-display properties are allowed.
Example (blocked):{gwp_user:user_pass}
If no one is logged in, {gwp_user} will return an empty string or a fallback (if you set one using conditional logic). This ensures your forms don’t leak or break when anonymous users visit.
Example output when logged out:User ID:
Yes. Use gwp_substring with start and length parameters to extract part of a user field, like a prefix from their login name.
Example:{gwp_user:user_login:gwp_substring start="0" length="4"}
Last updated: 21-07-2025