Smart Tag Usage Examples

Do you want to see some examples of how you can use WPForms Smart Tags? This handy feature can display input from your forms in your notifications, confirmations, default values, and more.

In this guide, we’ll share some examples of how you can use Smart Tags in WPForms.

For more information on Smart Tags and how to use them, please see our guide to using Smart Tags.

Sending Notifications to the WordPress Admin Email Address

This Smart Tag will insert the email address of the site administrator from your WordPress settings.

To check your site’s admin email, log into your WordPress admin area and navigate to Settings » General. On this page, look for the Administration Email Address field.

The Administration Email Address setting

In your form notifications settings, you can add this Smart Tag to the Send To Email Address, From Email, or Reply-To Email Address fields, rather than typing out the site administrator’s email address.

Adding the {admin_email} Smart Tag to the Send To Email Address field in the notifications settings

Showing Input From a Specific Field

The {field_id} Smart Tag pulls the value that a user has added to or selected from a specific field in your form. It can be found in the notifications settings in the form builder when you click on Show Smart Tags.

Opening the Smart Tag options in the notifications settings

If you’d like to manually create a field-specific Smart Tag, you can replace # with the ID of a specific field. For example, a field with the ID #3 will use the Smart Tag {field_id="3"}.

In the form builder, you can click on a field in the form preview area to see its field ID in the Field Options panel.

Locating the field ID in the Field Options panel

You can use a field-specific Smart Tag if you’d like to include user-submitted information in your notifications. For example, you can add a Smart Tag for the Email field in your notification’s Send To Email Address field.

Adding a field-specific Smart Tag to the notifications settings

Displaying HTML-Processed Values

The {field_html_id} Smart Tag will pull the HTML-processed value from a specific field in your form. By doing this, the value will retain its HTML tags when sent through email, enabling you to embed field labels, signatures, image choices, and more directly in your notification emails.

You can add this Smart Tag directly to the Email Message field in your notifications settings.

Adding the {field_html_id} Smart Tag to the Email Message field

As an example, let’s look at how this works with the Signature field.

Note: Make sure to replace # with the field ID number of the Signature field from your own form.

On the frontend of your site, users can draw their signatures in the Signature field:

An example of the Signature field on the frontend

If you use the {field_id="#"} Smart Tag, this field will appear in your form notification emails as a link, which you would have to click on to view the signature.

A Signature field link in an email notification

However, using the {field_html_id} Smart Tag, you can embed the signature right in your notification email.

A Signature field embedded in an email notification

Below is a list of all the fields you can change with the {field_html_id} Smart Tag:

  • Signature: Directly embeds an image of the signature into notification emails.
  • Number Slider: Formats the numerical input in your notification email as “Selected Value: [X] (0 min / 10 max).”
  • File Upload: Displays uploaded file paths by file name, rather than displaying the full WordPress link.
  • Rating: Displays the star rating and a numerical representation of the rating in the body of the email.
  • Images Choices: Displays the selected image for fields that support image choices.

Showing All Fields in a Form

This Smart Tag displays all the submitted information from your form fields in your notification emails.

By default, form notifications settings include this Smart Tag in the Email Message field to display the entry contents when the notification email is sent.

The {all_fields} Smart Tag in the Email Message field

Note: The Page Break, Section Divider, and HTML fields are not included in the {all_fields} Smart Tag by default. To include them in the {all_fields} Smart Tag and display them in your notifications, you’ll need to add a custom code snippet.

If you’d like to provide more information to the user, you can add details above or below the Smart Tag. You can also remove the Smart Tag so the entry contents are not included in your email notification.

If you’d like to see how a notification email with the {all_fields} Smart Tag looks, check out our guide on setting up notification emails.

Viewing the Page the Form Was Submitted From

The {page_title}{page_url}, and {page_id} Smart Tags display the title, URL, or ID of the page on which the form is embedded. It’s most useful when you have embedded the same form on more than one page.

By adding one of these Smart Tags to either the Email Subject Line or Email Message in your notifications settings, you can see exactly which page a user was on when they submitted your form.

Seeing the Date the Form Was Submitted

The {date format="m/d/Y"} Smart Tag will tell you the date when a form was submitted. You may find this useful for record-keeping, particularly if you might resend a notification sometime after submission, or if the submission date is particularly important.

You can add it to the Email Message field of your notifications settings.

Note: If your site uses caching, the date and time values that are pulled into this Smart Tag will be the date when the page was last cached (this is usually within the previous 12-24 hours). So, if you’re using this Smart Tag to track the date and time of form submissions, this value may not match the actual entry date.

To be sure the entry’s correct date information is pulled when using caching, use the {entry_date} Smart Tag.

If you’d like to also include a time stamp, you can change the {date format="m/d/Y"} Smart Tag to the following format: {date format="m/d/Y h:i:s A"}.

Note: If you’d like to, you can use PHP parameters for alternative date and time formats. For customizing the Date Smart Tag format in your forms, check out our developer documentation.

Identifying Entries From the Same User

With the {unique_value} Smart Tag, you can add unique identifiers to every form entry. It is useful for identifying individual form entries from the same user or email address. You can also display its output on the frontend and in form notifications.

To include the {unique_value} Smart Tag in your forms, we recommend using a Hidden Field or HTML field.

Adding {unique_value} to a Hidden Field

By using a Hidden Field, you can mark each entry with a unique ID that is only visible from within your WPForms entries. With an HTML field, you can display the output of the {unique_value} Smart Tag on the frontend of your forms.

Note: For more information on Hidden Fields, be sure to check out our tutorial on using Hidden Fields with WPForms.

If you’d like to use this Smart Tag on the frontend, check out our tutorial on using HTML fields.

Showing Author Details in Your Forms

The following Smart Tags enable you to pull details about authors on your WordPress site:

  • {author_id}: Reveals the ID number of the author of the page or post on which a form is embedded.
  • {author_display}: Reveals the name of the author of the post or page on which the form is embedded.
  • {author_email}: Inserts the email address of the author of the page where the form is embedded.

You can find an author’s ID by clicking on their name in the Posts or Pages sections of your WordPress admin area and looking at the browser address bar. In this example, the author has an ID of 1.

Viewing the author ID number in the browser address bar

The {author_id} Smart Tag might be useful if you want a quick record of a post or page author included in the Email Message of a notification.

The {author_email} is useful if you want the author of the page to receive a notification when a user submits the form. You can add it as the Send To Email Address for the notification to accomplish this without having to set up a new conditional notification for each author.

Showing Logged-In User Details in Your Forms

User management Smart Tags are some of the most useful Smart Tags for community-powered sites, like forums or membership sites that require users to create accounts.

For instance, the {user_display} Smart Tag will insert the user’s display name.

You can add this Smart Tag to a field description to show the current user’s display name so they can check that they’re using the correct account.

Adding the {user_display} Smart Tag to a field description

Here’s an example of how it might look on the frontend:

The {user_display} Smart Tag on the frontend

You can also added users’ names and email addresses as default values to auto-fill the Name and Email fields using the {user_full_name}, {user_first_name}, {user_last_name}, and {user_email} Smart Tags. Just enter the appropriate Smart Tag in the Default Value field in the Advanced Field Options.

Adding the {user_first_name} Smart Tag as a default value

The {user_meta} Smart Tag can be used to pull custom user meta data from your site. You can pull any data from a user profile as long as you know the meta key.

Entering the {user_meta} Smart Tag for a Phone Number custom field

You can read our guide on setting up custom user meta fields for more details and step-by-step instructions.

You can add links in your forms for users to log in, log out, or register for a new account using the following Smart Tags:

  • {url_login}
  • {url_logout}
  • {url_register}

These Smart Tags can be useful for custom login and registration forms. For example, you might add them in the Username field description of your login form so that users with existing accounts can easily sign in.

Adding the {url_login} Smart Tag to a field description

Here’s an example of how it might look on the frontend:

An example of the {url_login} Smart Tag on the frontend

Adding a Password Recovery Link to Your Form

The {url_lost_password} Smart Tag inserts the lost password link for your site.

When a user forgets their password, this Smart Tag provides the address they need to go to in order to reset it. If you have a login form built with WPForms, you might consider including a reset link in the description area of the Password field.

Adding the {url_lost_password} Smart Tag to a field description

Here’s an example of how it might look on the frontend:

An example of the {url_lost_password} Smart Tag on the frontend

Note: Interested in creating custom user Smart Tags that can pull information directly from WordPress user profiles? For detailed instructions on setting this up, including adding unique user data like nicknames, user roles, and biographies, please refer to our developer documentation on how to create more user Smart Tags.

Displaying User Registration Information

The following Smart Tags work with our User Registration addon. They pull useful data for including in automated emails for user activation, password resets, and more:

  • {site_name}: Inserts your site’s name as it’s listed in your WordPress settings.
  • {user_registration_login}: Inserts the username of the new user that has been created.
  • {user_registration_email}: Adds the new user’s email address to notification emails sent out by the User Registration addon.
  • {user_registration_password}: Inserts the password of the newly registered user.
  • {url_manage_activations}: Inserts a link to the admin screen where you can manually approve and activate new user accounts on your site.
  • {url_user_activation}: Adds a link users can click to activate their new accounts.
  • {user_registration_password_reset}: Inserts a password reset link.

Note: These Smart Tags only work in the emails generated by the User Registration addon. They will not pull data into other parts of your forms, such as regular notification emails or default values.

In this example, you can see the site name displayed at the top of the email. The message also includes the {user_registration_login}, {user_registration_email}, and {url_manage_activations} Smart Tags.

A website's name inserted into an email using the {site_name} Smart Tag

This email uses the {url_user_activation} Smart Tag to allow users to activate their new accounts via email.

A user registration email activation link inserted into an email with the {url_user_activation} Smart Tag

And this email shows the link that’s inserted when you use the {user_registration_password_reset} Smart Tag.

A password reset link inserted into an email using the {user_registration_password_reset} Smart Tag

That’s it! Now you know some of the ways you can use Smart Tags in your forms.

Next, want to collect hidden user data from your forms? Learn how to gather IP addresses, location data, and more using Smart Tags in our guide to unlocking hidden user data.