Using Smart Tags

Do you want to add user or site data to your form notifications and other form settings automatically? Smart Tags can save you time by enabling you to include helpful details in your forms.

This tutorial will show you how to use Smart Tags in WPForms.


What Is a Smart Tag?

A Smart Tag is a bit of code that you can use to insert relevant information into your form notifications settings or as field default values. Smart Tags use curly brackets and look something like this:

{smart_tag}

For example, a widely used Smart Tag is {admin_email}, which is added by default to the Send To Email Address field in the form notifications settings. It automatically fills in the email address of the site administrator from your site’s WordPress settings.

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

Adding Smart Tags to Your Forms

You can use Smart Tags when configuring notifications settings, setting up field options in the form builder, or adding a form description.

Notifications Settings

To access the notifications settings for your form, open the form builder and go to Settings » Notifications. In the top right corner of each field, you can click on Show Smart Tags to see a list of the Smart Tags that are applicable for a particular field.

Accessing Smart Tags for a field in the notifications settings

To add a Smart Tag to the field, click on it in the list.

Adding a Smart Tag for the form's Email field as the Send To Email Address in the notifications settings

The relevant information will be added to the email notification after a user submits their entry.

Default Field Values

When editing some fields in your forms, you can add Smart Tags as default values. To do so, open your form builder and click on a field to open its Field Options panel.

From here, click on the Advanced tab and find the Default Value field. Then select the Show Smart Tags option.

Viewing Smart Tags for the Email field's default value

This will show a list of all the available Smart Tags for this field. Click on one to add it as the default value for the field.

Selecting a Smart Tag to use as the default value of a field

On the frontend, the field will be pre-filled with the relevant information from the Smart Tag.

A form with fields pre-filled by default values set by Smart Tags

Form Descriptions

You can use Smart Tags to include custom details in your form descriptions. When the form loads on the frontend, the Smart Tag will be replaced with the relevant data.

For example, you could add the administrator’s email address to the form description using the {admin_email} Smart Tag:

Adding the {admin_email} Smart Tag to a form description

Then, in the embedded form’s description, the Smart Tag will be replaced with the site’s administrator email address.

Displaying the admin email in a form description on the frontend using a Smart Tag

Note: For more advanced ways to add Smart Tags to your forms, you can check out our tutorial on processing Smart Tags in Checkboxes field labels and HTML fields.

Smart Tags Available in WPForms

Below is a list of the Smart Tags available in WPForms:

Basic Smart Tags

Here you’ll find a few basic Smart Tags available in WPForms.

{admin_email}

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

{field_id="#"}

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

{field_html_id="#"}

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.
{field_value_id="#"}

Note: This Smart Tag is only recommended for developers and advanced users.

The {field_value_id} Smart Tag pulls the raw value that a user has added or selected to a specific payment field in your form. When used in an email notification, it will show an unformatted version of the content.

This is useful if you’re looking to do some custom development using the values submitted to your forms’ payment fields.

Like the {field_html_id} Smart Tag, you can enter the {field_value_id} Smart Tag directly into the body of your email notification.

Note: If you’re looking to customize the values that are returned by this Smart Tag, check out our developer documentation for more information.

{all_fields}

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.

{entry_id}

When a user submits a form, the entry is assigned a unique ID. You can find the entry ID in the Entry Details section of the individual entry page.

Viewing an entry ID

As each entry is given a unique ID, this Smart Tag can be useful for tracking entries. For example, you can add the {entry_id} Smart Tag to the Email Subject Line field in your form’s notifications settings. This will enable you to easily find the entry so you can review it.

Note: Currently the {entry_id} Smart Tag only works in form notifications.

{entry_details_url}

This Smart Tag provides a link to the admin page corresponding to a particular entry.

entries detail url Smart Tag.

It will generate and include this URL when included in the Email Message or Email Subject Line field of an email notification.

You can also use this URL with some marketing addons, such as Drip.

{form_id}

Each form is assigned a unique ID number. This Smart Tag will display the ID number of the current form.

The ID of a form can be seen in its shortcode. You can find it in the Shortcode column on the Forms Overview page. In the example below, the form has an ID of 88.

Viewing the form ID in the Shortcode column of the Forms Overview page

You can also find a form’s shortcode by clicking on the Embed button in the form builder.

The Embed button in the form builder

This will open up a popup with embed options. To view the shortcode for your form, click the Use a shortcode option to find your form’s ID.

Finding the form ID in the Embed tool

By adding the {form_id} to the Email Subject Line in your form’s notifications settings, you may find it easier to keep track of which form a user filled out (especially if you have more than one form by the same name).

{form_name}

This Smart Tag will display the title of your form.

To check or change your form name, open the form builder and go to Settings » General.

Editing the form name

Adding this Smart Tag to the Email Subject Line in your form’s email notifications settings can be very helpful when trying to keep your inbox organized and easy to search. It can also be helpful if you send notifications to your users, as it reinforces that their submission for a specific form was successful.

{page_title}

This Smart Tag displays the title 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 this Smart Tag 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.

{page_url}

This Smart Tag displays the web address (URL) of the page on which the form is embedded. Much like {page_title}, it can be handy to add this Smart Tag to either the Email Subject Line or Email Message in your notifications settings when you’ve embedded the same form on several pages.

When used in the Email Message field, this Smart Tag tells you which page a specific visitor was on when they submitted your form. It also enables you to go to that page quickly by clicking on the URL in the notification email.

{page_id}

Each post or page on your site has a unique ID. The {page_id} Smart Tag inserts the ID for the page on which the form is embedded.

You can find the page ID in the browser address bar when you’re editing a post or a page. The example below shows a page with the ID 7.

Locating the page ID in the browser address bar

The {page_id} Smart Tag can be useful in the same way as the {page_title} and {page_url} Smart Tags. Adding it to an Email Subject Line or Email Message in your notifications settings will let you know which page a user was on when they submitted a form.

However, unlike a page’s title or URL, the ID associated with a page can never be changed.

{date format="m/d/Y"}

This 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.

{unique_value}

With this 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.

{url_referer}

This Smart Tag will insert the address of the page that referred the user to the current page.

It can be useful as a default value for a Hidden Field in your form, which will be invisible to your users but displayed in your entries.

Adding the {url_referer} Smart Tag to a Hidden Field

For example, if a user went from your site’s home page to your contact page, and then filled out your contact form there, this Smart Tag would display the URL of your home page as the value of your Hidden Field.

Note: Using the {url_referer} Smart Tag in your email notifications will insert the URL of the page from which the form was submitted, not the page that referred the user to the form. Unless you would like to see this information in your notification emails, we recommend using this Smart Tag in a Hidden Field as described above instead.

{resume_link}

This Smart Tag lets users save their progress in your forms and return to complete and submit their entries later.

Note: You’ll need to install and activate the Save and Resume addon before you can use the {resume_link} Smart Tag.

Unlock Hidden User Data

Use these Smart Tags to gather more information about your users without having to ask for it by adding more fields to your forms.

{user_ip}

Each computer connected to the internet has a unique address. This Smart Tag allows you to see the unique IP address of each user who submits your form.

If you’d like to know the IP address of anyone who fills out your forms, you can use this Smart Tag in the Email Message section of your form’s notifications settings, or as the default value of a Hidden Field.

{entry_geolocation}

This Smart Tag allows you to see information for the approximate locations of your users.

Note: The {entry_geolocation} Smart Tag requires our Geolocation addon. Check out our tutorial on how to install and use the Geolocation addon for more details.

You can add this Smart Tag to the Email Message field of a notification as a quick reference for where the user is located. This can be particularly helpful if you need to know their time zone for a phone call.

{user_id}

Every registered user on your WordPress site is assigned an ID number. This Smart Tag allows you to see the User ID when a logged-in user submits your form.

This Smart Tag can be helpful if you’re creating a survey form for your logged-in users. It enables you to track unique submissions without you having to ask users for their names.

{query_var key=""}

This Smart Tag is also known as Query String Variable. You can use it to auto-fill certain fields for your users.

Query strings require a little extra setup. You can read our guide on how to use query strings for more details and step-by-step instructions.

{entry_user_journey}

This Smart Tag is used to display the pathway a user took before opening and submitting your form.

Note: You’ll need to install and activate the User Journey addon before you can use the {entry_user_journey} Smart Tag.

Author Details

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

{author_id}

This Smart Tag reveals the ID number of the author of the page or post on which a 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. Note that for some users, their ID and display name might be the same.

{author_display}

This Smart Tag reveals the name of the author of the post or page on which the form is embedded. It might be useful to include this information in a notification’s Email Message, especially if it’s different from the Author ID.

{author_email}

This Smart Tag will insert the email address of the person who created the form.

It’s 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.

User Management

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

{user_display}

If a user is logged in, this Smart Tag will insert their display name.

You can add this Smart Tag to a field description to display 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

{user_full_name}

If a user is logged in and submits a form, this Smart Tag will insert their first and last name. You can use it to auto-fill the Name field in a form for logged-in users.

Adding the {user_full_name} Smart Tag as a default value

{user_first_name}

If a user is logged in and submits a form, this Smart Tag will insert the first name from their WordPress user profile. You can use it to auto-fill the first name of logged-in users.

Adding the {user_first_name} Smart Tag as a default value

{user_last_name}

If a user is logged in and submits a form, this Smart Tag will insert the last name from their WordPress user profile. You can use it to auto-fill the last name of logged-in users.

Adding the {user_last_name} Smart Tag as a default value

{user_email}

This Smart Tag will insert the email of a logged-in user who submits a form. It lets you auto-fill a form’s Email field for logged-in users.

Adding the {user_email} Smart Tag as a default value

{user_meta}

This 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.

{url_login}

This Smart Tag inserts the login URL for your site. Your users can go to this web address to log in to your site.

If you use our User Registration addon, you might consider using this Smart Tag to provide a login link in your registration form. This can be convenient for users who already have accounts.

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

{url_logout}

This Smart Tag inserts a URL your users can click to log out of your site.

If users must be logged in to access a form, you might consider adding a link with this Smart Tag to let them log out if they’re accidentally using the wrong account.

Adding the {url_logout} Smart Tag to a field description

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

The {url_logout} Smart Tag on the frontend

{url_register}

This Smart Tag inserts the WordPress registration URL for your site. If your site allows users to register themselves, this is the web address they’ll need to go to in order to sign up.

If you’re using WPForms to customize a login form for your site, this Smart Tag is useful for adding a link to take unregistered users to the default WordPress registration page.

Adding the {url_register} Smart Tag to a field description

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

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

{url_lost_password}

This 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.

User Registration

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

Note: The following 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.

{site_name}

This Smart Tag inserts your site’s name as it’s listed in your WordPress settings. It’s used in user registration admin notification emails to let you know that a new account has been created.

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

{user_registration_login}

Adding this Smart Tag to a user registration notification email will insert the username of the new user that has been created.

A username inserted into an email using the {user_registration_login} Smart Tag

It’s used in the default messages for admin notification and user login information emails.

{user_registration_email}

The {user_registration_email} Smart Tag adds the new user’s email address to notification emails sent out by the User Registration addon.

A user's email address inserted into an email using the {user_registration_email} Smart Tag

It’s used in the default messages for admin notification emails.

{user_registration_password}

This Smart Tag inserts the password of the newly registered user.

A user's password inserted into an email using the {user_registration_password} Smart Tag

It’s used in the default message for user login information emails.

{url_user_activation}

The {url_user_activation} Smart Tag inserts the link users will need to click to activate their new accounts via email.

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

{url_manage_activations}

This Smart Tag will insert a link to the admin screen where you can manually approve and activate new user accounts on your site.

The admin manage activations link inserted using the {url_manage_activations} Smart Tag

{user_registration_password_reset}

Adding this Smart Tag to your automatic password reset email inserts the link users will need to follow to create new passwords for their accounts.

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

Frequently Asked Questions

Below, we’ll address some of the top questions we see about using Smart Tags:

Is there a Smart Tag that can pull only the first or last name from an entry?

If you’d like to pull a subfield of your form’s Name field, you can use the {field_id} Smart Tag with a vertical slash to display this information.

For example, to pull only the first name from your form, you would use the {field_id="#|first"} Smart Tag.

Using the {field_id} Smart Tag to pull the first name from the form entry into an email notification

Below is the full list of available options for the Name field:

  • First Name: {field_id="#|first"}
  • Middle Name: {field_id="#|middle"}
  • Last Name: {field_id="#|last"}
Can I use a Smart Tag to display individual lines from an Address field?

Yes, you can use the {field_id} Smart Tag followed by a vertical slash (|) to show individual lines from your form’s Address field.

For example, if you only wanted to show the street entered by a user, you would use the Smart Tag {field_id="#|address1"}.

The available Smart Tag options for the Address field are:

  • Line 1: {field_id="#|address1"}
  • Line 2: {field_id="#|address2"}
  • City: {field_id="#|city"}
  • State/Region: {field_id="#|state"}
  • Zip Code/Postal Code: {field_id="#|postal"}
Is there a Smart Tag that can pull the time value from a form?

You can pull time data from your forms by adding the H:i suffix to the {date} Smart Tag.

Adding the submission time to the {date} Smart Tag

If you’re looking to separate the time from the date, you can use the {field_id="#|time"} for the time and {field_id="#|date"} for the date.

Note: It’s possible to pull additional information into the form fields and settings by using a custom Smart Tag. For more details and examples, check out our guide on how to create your own Smart Tag.

Can I create a Smart Tag for my site’s URL to use in notifications and confirmations?

Yes, you can create a custom Smart Tag for your site’s URL to easily include it in email notifications or confirmation messages. For detailed guidance on how to set this up, refer to our developer documentation for more information.

Can I use a Smart Tag to display only the quantity from a Single Item/Dropdown Items payment field?

Yes, you can use a Smart Tag to specifically show the quantity from a Single Item or Dropdown Items payment field in WPForms. To achieve this, utilize the following Smart Tag format in your form: {field_id="#|quantity"}. Replace # with the actual field ID of your payment field to accurately display the quantity selected by the user.

Can I use a Smart Tag to display a summary of user-purchased items?

Yes, if you enabled order summary in your payment form, you can use a Smart Tag to show a summary of items users purchased from your site. Here’s the format for the Smart Tag: {order_summary}.

That’s it! You’ve just learned how to use Smart Tags in WPForms.

Next, do you want to display certain form fields based on users’ input? Be sure to check out our tutorial on how to use conditional logic in your forms.