WPForms Documentation

Documentation, Reference Materials and Tutorials for WPForms

How to Use Smart Tags in WPForms

Want to create more advanced forms and notifications? Smart tags save you time and allow you to set up more advanced forms by dynamically entering the right information in your WPForms notifications and other settings.

Let’s take a look at how to use smart tags in WPForms.

What is a Smart Tag?

A smart tag is a bit of code that you can use in your forms to make sure the right information is inserted where it needs to be. Smart tags use curly brackets and look something like this:

{smart_tag}

If you’re a WPForms user, chances are you’ve already seen smart tags in action while customizing your notifications settings.

For example, a widely used smart tag is {admin_email}, which is the default smart tag used in the Send To Email Address field. It automatically fills in the email address of the site administrator.

smart tag example

You can see the entire list of smart tags that are applicable for a particular field by clicking the Show Smart Tags option.

selecting a smart tag

Because there are a lot of smart tags available, we’ve create a table of contents to help you navigate this guide. Just click on the smart tag you’re interested in for a more detailed description and examples of how to use it.

Table of Contents


Basic Smart Tags

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

Not sure what your site’s admin email is? From your WordPress dashboard, go to Settings » General and look to the Email Address field.

How to Use: You could add this smart tag to a notification’s Send To Email Address, From Email, or Reply-To field rather than typing out the site administrator’s email address.

smart tag admin_email

{entry_id}

Whenever someone submits a form, it is counted as a new entry with a unique ID. The unique entry ID corresponding to the current entry can be inserted anywhere using this smart tag.

entry id

How to Use:  For record-keeping, it might be useful to add the Entry ID to the Email Subject on your form’s notification.

{form_id}

You may have multiple forms on your site. Each form is given a unique ID number. This smart tag will insert the ID number of the current form.

You can find the unique form ID…

      • in your address bar
      • in the embed code
      • using the inspector tool

In the URL address bar:

url form id

In the embed code:

embed form via id

Using the inspector tool:

view form id in WPForms

How to Use: By adding the Form ID to the Email Subject on your form’s notification, 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 insert the title of your form.

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

Change form title

How to Use: Adding this tag to the Email Subject on a form’s admin notification 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 inserts the title of the page in which the form is embedded.

How to Use: This tag is most useful when you have embedded the same form on more than one page. By adding it to either the Email Subject or Message on your admin notification, you can see exactly what page a user was on when they submitted your form.

{page_url}

This smart tag inserts the web address (URL) where the form is embedded.

How to Use: Much like the Page Title tag, this can be handy to add to either the Email Subject or Message on your admin notification when you’ve embedded the same form on several pages and want to know which page a specific visitor was using.

{page_id}

This tag inserts the page ID where the form is embedded. You can find the page ID in the address bar when you’re editing a post or a page.

page id
How to Use: Page ID can be useful in the same way as a title or URL, as adding this smart tag to an Email Subject or Message on your admin notification will let you know which page a user was on when they submitted a form. Unlike a page’s title or URL, however, the ID associated with a page can never be changed.

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

This smart tag will tell you the date when the form was submitted.

How to Use: You may find this useful for record-keeping in the Message field of your admin notification (particularly if you might resend a notification sometime after submission, or if the submission date is particularly important).

{url_referer}

This smart tag will insert the address of the page which referred the user to the page containing the form.

For example, if a user went from your home page to your contact page, and then filled out your form there, this smart tag would give you the URL of your home page.

How to Use: You might consider adding this tag to an admin notification’s Message field or in a Hidden Field on your form, which will be invisible to your users but displayed in your entries.

Hidden field for URL Referer

Unlock Hidden User Data

Use these smart tags to gather more information of your customers without needing to ask for it in additional fields.

{user_ip}

Each computer on the internet contains a unique address. This tag allows you to see the unique address of each user.

How to Use: If you’d like to know the IP address of anyone who contacts you, you can use this smart tag in the Message section of a notification.

{entry_geolocation}

This smart tag allows you to see where in the world your visitor is located when submitting your form. This requires our Geolocation addon.

How to Use: You can add this smart tag to the Message field of a notification as a quick reference for where your user is located, which can be particularly helpful if you need to know their time zone for a phone call.

You can check out our tutorial on how to install and use this addon for more details.

{user_id}

Every logged in user is assigned an ID number on your WordPress site.

How to Use: If you’re conducting a survey among your logged in users, using this tag can be helpful. It reveals who submitted your form on your site without you having to ask their name.

{query_var key=""}

This smart tag is also known as Query String Variable, and can be used to auto-fill certain fields for your user.

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

Author Details

Learn more details about authors using these smart tags.

{author_id}

This smart tag reveals the author ID number of the post or page from which the form was submitted. You can find it by viewing All Posts or All Pages of any author in WordPress.

author id

How to Use: This smart tag might be useful to use as a quick record of a post or page author inside the 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/page.

How to Use: This smart tag might be useful inside the Message of a notification, especially if different from the Author ID.

{author_email}

This smart tag will insert the email address of the post/page author.

How to Use: This smart tag is useful if you want the author of the page to receive a notification. The form notification will automatically be sent to the author of the page from which the form was submitted, without having to set up a different form for each page.

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 an account.

{user_display}

If a user is logged in and submits a form, this smart tag will insert the name of the user.

How to Use: This tag can be used to auto-fill a name on a form for logged-in users, or can be used to check that the user is logged in under the correct account as demonstrated in the screenshot below.

smart tag url_logout

{user_email}

This smart tag will insert the email of the user who submits a form.

How to Use: This smart tag is a great way to auto-fill a form’s Email field for logged in users.

Set user Email as default for Email field

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

How to Use: If you use our User Registration addon, you might consider using this smart tag to provide a login link on your registration form. This can be convenient for users who already registered.

smart tag url_login

{url_logout}

This smart tag inserts the URL your user needs to click on to log out of your site.

How to Use: 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 in case they are accidentally under the wrong account.

smart tag url_logout

{url_register}

This smart tag inserts the registration URL for your site. If your site allows users to register themselves, this is the web address they’ll need to go to to sign up.

How to Use: If you use WPForms to make a login form for your site, this smart tag is useful for adding a link to take unregistered users to your registration form.

smart tag url_register

{url_lost_password}

This smart tag inserts the lost password link for your site.

How to Use: When a user forgets their password, this smart tag provides the address they need to go to reset the password. If you have a login form run by WPForms, you might consider including a reset link in the description area of the Password field.

smart tag url_lost_password

That’s all! Now you’re an expert in using WPForms smart tags. You might also want to check out our guide on using query strings to auto-fill a text field.