Estimated reading: 19 minutes 1453 views

Bit form Smart Tags

Smart tags are helpful to display and get static and dynamic information from the user. A smart tag is some form of default short-code of Bit Form, which gets the static information of the WordPress user you use.
For example: Here is a smart tag ${_bf_admin_email} that can be used in the Email template to pull the site admin email. Also, you can show this information in your form on the front end with conditional logic and form submitted success or error message. Smart Tags use the dollar sign and curly brackets, and look something like.
Example: ${_bf_user_display_name}

How to use Smart Tags

Integration

You can get a User IP address by sending it to a third-party app via integration. First, set up a complete authorization process for integration. Then you will get the option to map the form field. There you will find the section of general smart code, and select the user IP address.

Integration smart tags

Conditional logic

On form load: The On Form Load action is used to dynamically alter a Form when it is loaded. The Form actions On Form Load are executed when the Form is loaded by a user. When a page is loaded and you want to pre-filled some field value. There are two ways to pre-filled a value:

  1. Use an initial field key in field properties in the form builder.
  2. Use the parameter in the URL. The parameter in the URL: website_url?field_api_name=field_value Example: https://www.bitappspro/?bf1-1=${_bf_user_first_name}

In the above example, after the form loading First Name will be User First Name and User Last Name. Many kinds of logic are used for On Form Load such as Equal, Not Equal, Is Null, Is Not Null, Contain, Not Contain, Start With, and End With.

Email Notification

You can send the admin name, email, and more default WordPress static data using smart tags via email notifications. Then you need to create an email template or edit the existing email template.
Next, you will find the Smart tag fields option. Select the option from the Drop-Down list that you want to send the data into the email notification.

Email template smart tag fields

Basic Smart Tags

LabelKey
Current Date Time${_bf_current_time}
Administrator Email${_bf_admin_email}
Date (default format)${_bf_date_default}
Date(mm/dd/yy)${_bf_date.m/d/y}
Date(dd/mm/yy)${_bf_date.d/m/y}
Date(Y/m/d${_bf_date.y/m/d}
Time${_bf_time}
Weekday${_bf_weekday}
Referer URL${_bf_http_referer_url}

Current Date Time

This smart tag inserted the current date and time when a form was submitted. The date and time will be set in your WordPress date and time format.
Example: ${_bf_current_time}

Administrator Email

This Smart Tag will insert the email address of the website administrator from your WordPress settings.
Example: ${_bf_admin_email}

Administrator email

Date (default format)

This smart tag inserted the date when a form was submitted. The date will be set in your WordPress default date format.
Example: ${_bf_date_default}

Date and time default format

Time

This smart tag is inserted on time when submitting a form. Example: If anyone submits the form at 11:00 am. Then with this smart tag, you know which time the user has submitted the form.

Example:${_bf_time}

Time

Weekday

This smart tag is inserted on weekdays when submitting a form. Example: If anyone submits the form on Friday. Then with this smart tag, you know which day the user has submitted the form.
Example: ${_bf_weekday}

Referer URL

This Smart Tag will insert the URL address of the page that referred the user to the current page.
Example: ${_bf_http_referer_url}

Custom User Data

LabelKey
User IP Address${_bf_ip_address}
Browser Name${_bf_browser_name}
Random String${_bf_random_digit}
Operating System${_bf_operating_system}

User IP Address

This smart tag allows you to see the IP address of the user who submitted the form. Example: ${_bf_ip_address}

Browser Name

To submit your form, the user has to submit the form from a computer or mobile through the browser. If you’d like to know the Browser name of anyone who fills out your forms, you can use this Smart Tag. Example: ${_bf_browser_name}

Random String

This smart tag generates a unique string.
Example: ${_bf_random_digit}

Operating System

If you’d like to know the operating system of anyone who fills out your forms, you can use this Smart Tag. Example: ${_bf_operating_system}

Author Details

LabelKey
Post Author ID${_bf_author_id}
Post Author Display Name${_bf_author_display}
Post Author Email${_bf_author_email}

Post Author ID

Each user has a unique Author ID. If you’d like to know the Author ID of the post or page on which the form is embedded, you can use this Smart Tag.
Example: ${_bf_author_id}

Author id

Post Author Display Name

Each user has an Author Display Name. If you’d like to know the Author’s Display Name of the post or page on which the form is embedded, you can use this Smart Tag.
Example: ${_bf_author_display}

Post Author Email

Each user has an Author Email. If you’d like to know the Author’s Email of the post or page on which the form is embedded, you can use this Smart Tag.
Example: ${_bf_author_email}

User Management

LabelKey
User ID${_bf_user_id}
User First Name${_bf_user_first_name}
User Last Name${_bf_user_last_name}
User Display Name${_bf_user_display_name}
User Nice Name${_bf_user_nice_name}
User Login Name${_bf_user_login_name}
User Email${_bf_user_email}
User URL${_bf_user_url}
Current User Role${_bf_current_user_role}
Site Title${_bf_site_title}
Site Description${_bf_site_description}
Site URL${_bf_site_url}
WordPress Locale Code${_bf_wp_local_codes}
Embedded Page / Post ID${_bf_post_id}
Embedded Page / Post Name${_bf_post_name}
Embedded Page / Post Title${_bf_post_title}
Embedded Page / Post URL${_bf_post_url}
Post Publish Date${_bf_post_date}
Post Modified Date${_bf_post_modified_date}
URL Query Parameter${_bf_query_param()}
User Meta Key${_bf_user_meta_key()}
Custom Date Format${_bf_custom_date_format()}
count${_bf_count()}
length${_bf_length()}

User ID

Each registered user on your WordPress site has a unique ID number. If you’d like to know the User ID when a logged-in user submits your form, you can use this smart tag. Example: ${_bf_user_id}

User First Name

Each registered user on your WordPress site has a First Name. If you’d like to know the First Name when a logged-in user submits your form, you can use this smart tag.
Example: ${_bf_user_first_name}

User Last Name

Each registered user on your WordPress site has a Last Name. If you’d like to know the Last Name when a logged-in user submits your form, you can use this smart tag.
Example: ${_bf_user_last_name}

User Display Name

Each registered user on your WordPress site has a Display Name. If you’d like to know the Display Name when a logged-in user submits your form, you can use this smart tag.
Example: ${_bf_user_display_name}

User Nice Name

Each registered user on your WordPress site has a Nice Name. If you’d like to know the Nice Name when a logged-in user submits your form, you can use this smart tag.
Example: ${_bf_user_nice_name}

User Login Name

Each registered user on your WordPress site has a Login Name. If you’d like to know the Login Name when a logged-in user submits your form, you can use this smart tag.
Example: ${_bf_user_login_name}

User Email

Each registered user on your WordPress site has a Login Name. If you’d like to know the Login Name when a logged-in user submits your form, you can use this smart tag.
Example: ${_bf_user_email}

User URL

Each registered user on your WordPress site has a profile. If you’d like to know the profile URL when a logged-in user submits your form, you can use this smart tag.
Example: ${_bf_user_url}

Current User Role

Each registered user on your WordPress site has a User Role. If you’d like to know the user role when a logged-in user submits your form, you can use this smart tag.
Example: ${_bf_current_user_role}

Site Title

This smart tag inserts the title of your website in your WordPress settings.
Example: ${_bf_site_title}

Site title

Site Description

This smart tag inserts the Tagline/Description of your website in your WordPress settings. Example: ${_bf_site_description}

Site description

Site URL

This smart tag inserts the Site URL of your website set in your WordPress settings.
Example: ${_bf_site_url}

Site url

WordPress Locale Code

This smart tag inserts the WordPress Locale Code(Site Language) of your website in your WordPress settings. If the user submits the form while logging in to WordPress, the user will see the language code added to WordPress.
Example: ${_bf_wp_local_codes}

Embedded Page / Post ID​

If you want to know the ID of the page/post from which page/post is submitting the form., you can use this Smart Tag. Each page/post ID on your WordPress site has a unique ID.
Example: ${_bf_post_id}

Embedded Page / Post Name​

If you want to know the Name of the page/post from which page/post is submitting the form, you can use this Smart Tag. Each page/post Name on your WordPress site has a Name.
Example: ${_bf_post_name}

Embedded Page / Post Title​

If you want to know the Title of the page/post from which page/post is submitting the form, you can use this Smart Tag. Each page/post Title on your WordPress site has a Title.
Example: ${_bf_post_title}

Embedded Page / Post URL​

If you want to know the URL of the page/post from which page/post is submitting the form, you can use this Smart Tag. Each page/post URL on your WordPress site has a URL.
Example: ${_bf_post_url}

Post Publish Date​

If you want to know the publish date of the page/post from which page/post is submitting the form, you can use this Smart Tag.
Example: ${_bf_post_date}

Post Modified Date​

If you want to know the last Modified Date of the page/post from which page/post is submitting the form, you can use this Smart Tag.
Example: ${_bf_post_modified_date}

User Meta Key​

If you have a custom user field in WordPress (Meta Box, ACF) then using this smart tag you will get the data of the custom field. To get the data of the custom field, you have to put the key of the custom field inside the smart tag.
Example: ${_bf_user_meta_key(company_name)}

Custom Date Format​

This smart tag inserted the custom date and time when a form was submitted. The date and time will be set in your WordPress date and time format.
Example: ${_bf_custom_date_format(l, F j, Y)}

Custom date format

count

With this smart tag you can count the words in a field.

Example: ${_bf_count(Message)}

In the example provided, a condition is established wherein if the Message field is not empty, the words inputted into the Message field will be counted and displayed in the Message field Helper Text.

length

This smart tag helps you count how many letters you’ve typed into a field.

Example: ${_bf_length(Message)}

In the example above, we’ve established a condition: if the Message field isn’t empty, the letters entered in the Message field will be counted and displayed in the Message field Helper Text.

Number

If you have multiple number-type fields, using the number function ensures it returns 0 instead of an empty string during calculations. Without this function, leaving a number field empty will result in an empty string, which can lead to invalid calculation results.

All data

Note-icon-bit-apps  Note

Starting from Bit Form Free version 2.18.2, you can use All data (${bf_all_data}) smart tag. This gives you more control over how and where the form data is displayed.

Bit Form now includes a smart tag called All data (${bf_all_data}), which automatically maps all form fields with just one tag. It’s the recommended way to send form data.

Why use it?

  • You don’t need to map each field one by one.
  • If you delete or change a field in the form, it won’t cause any errors.
  • It automatically updates to reflect your current form setup.

You can use the ${bf_all_data} smart tag in email templates and PDF templates. It works seamlessly even with Repeater fields. If you add a Repeater Field in the form builder, all the data inside it—no matter how many fields you include—will be automatically mapped using this tag. It’s a simple and dependable way to include all form data without manual mapping, ensuring even repeated entries are captured effortlessly and making your setup quicker, cleaner, and more flexible.

Let’s look at an example. Suppose you have a Bit Form—now let’s create an email and PDF template, use the All Data smart tag in both, and see the results in action.

Smart Date/Time Difference Calculator

The bfCalculateDateTimeDifference() function in Bit Form lets you calculate the difference between two date/time values and return the result in your preferred unit—like seconds, minutes, hours, days, weeks, or months.

It’s incredibly useful for workflows that require duration calculation, such as calculating:

  • Days between two form dates
  • Hours left until a deadline
  • Weeks in a subscription period
  • Minutes between login and logout times

How It Works

bfCalculateDateTimeDifference(startDateTimeStr, endDateTimeStr, returnUnit)

Parameters:

NameTypeRequiredDefault valueDescription
startDateTimeStrstringrequiredtodayStart date/time in any supported format
endDateTimeStrstringoptionaltodayEnd date/time in any supported format
returnUnitstringoptionaldaysUnit for the result: 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months', ‘years’

Returns:

  • A number representing the difference between the end date/time and the start date/time in the specified units. The result is returned as a whole number (any fractional difference is floored, i.e. rounded down to the nearest whole unit).
    • If the end date/time is later than the start date/time, the result will be positive.
    • If the end date/time is earlier than the start date/time, the result will be negative (because it’s calculating end minus start).

Supported Date Time Formats:

1. Special Keywords

  • today / now: Case-insensitive, quotes allowed

2. Date-Only Formats

  • YYYY-MM-DD: "2023-05-15" – ISO date format
  • YYYY.MM.DD: "2023.05.15" – Dot-separated
  • YYYY/MM/DD: "2023/05/15" – Slash-separated
  • YYYY-MM: "2023-05" – Returns first day of the month
  • YYYY-Www: "2023-W23" – ISO week (returns Monday of that week)
  • MM/DD/YYYY: "05/15/2023" – US format
  • MM/DD/YY: "05/15/23" – Short year, resolved as 20 + YY
  • DD.MM.YYYY: "15.05.2023" – European format

3. Time-Only Formats

  • HH:mm: "13:45" – 24-hour format, sets to current date
  • HH:mm:ss: "13:45:30" – 24-hour with seconds, sets current date
  • hh:mm:ss AM/PM: "01:45:30 PM" – 12-hour format with seconds
  • hh:mm AM/PM: "1:45 PM" – 12-hour (1–12), sets current date

4. Combined Date-Time Formats:

ISO Formats (with “T”)

  • YYYY-MM-DDTHH:mm: "2023-05-15T13:45" – Seconds default to :00
  • YYYY-MM-DDTHH:mm:ss: "2023-05-15T13:45:30" – Full ISO datetime

Space-Separated Formats:

Hyphen-Dates (-)

  • YYYY-MM-DD HH:mm:ss: "2023-05-15 13:45:30"
  • YYYY-MM-DD hh:mm:ss AM/PM: "2023-05-15 01:45:30 PM"
  • YYYY-MM-DD HH:mm: "2023-05-15 13:45"
  • YYYY-MM-DD hh:mm AM/PM: "2023-05-15 01:45 PM"

Dot-Dates (.)

  • YYYY.MM.DD HH:mm:ss: "2023.05.15 13:45:30"
  • YYYY.MM.DD hh:mm:ss AM/PM: "2023.05.15 01:45:30 PM"
  • YYYY.MM.DD HH:mm: "2023.05.15 13:45"
  • YYYY.MM.DD hh:mm AM/PM: "2023.05.15 01:45 PM"

Slash-Dates (/)

  • YYYY/MM/DD HH:mm:ss: "2023/05/15 13:45:30"
  • YYYY/MM/DD hh:mm:ss AM/PM: "2023/05/15 01:45:30 PM"
  • YYYY/MM/DD HH:mm: "2023/05/15 13:45"
  • YYYY/MM/DD hh:mm AM/PM: "2023/05/15 01:45 PM"

US Formats (MM/DD/YYYY)

  • MM/DD/YYYY hh:mm:ss AM/PM: "05/15/2023 01:45:30 PM"
  • MM/DD/YYYY hh:mm AM/PM: "05/15/2023 01:45 PM"
  • MM/DD/YYYY HH:mm: "05/15/2023 13:45"

European Formats (DD.MM.YYYY)

  • DD.MM.YYYY HH:mm:ss: "15.05.2023 13:45:30"
  • DD.MM.YYYY HH:mm: "15.05.2023 13:45"

Note-icon-bit-apps  Note

You can also use ${bf_separator} instead of a comma for separating values but if your date format contains comma(‘,’) you must use bf_separator.

Example:

bfCalculateDateTimeDifference(startDateTimeStr ${bf_separator} endDateTimeStr ${bf_separator} returnUnit)

Examples:

// Days between two dates
bfCalculateDateTimeDifference('2023-01-01', '2023-01-10', 'days')
// ➜ Returns: 9


// Weeks in a month
bfCalculateDateTimeDifference('2023-01-01', '2023-01-31', 'weeks')
// ➜ Returns: 4

// example with bf_separator and without quetes(' ')
bfCalculateDateTimeDifference(2023-01-01 ${bf_separator} 2023-01-31 ${bf_separator} weeks)
// ➜ Returns: 4
// example with bf_separator and Fiels Key
bfCalculateDateTimeDifference(${b4-10} ${bf_separator} ${b4-4} ${bf_separator} weeks)

Why Use It?

  • Automate calculations for durations, deadlines, and scheduling
  • Avoid complex date math manually
  • Compatible with Smart Tags and formulas inside Bit Form

Date/Time Add Subtractor

The bfAddOrSubtractDateTime() function in Bit Form allows you to add or subtract date time from a specific date or time value while preserving the original format. This is perfect for use cases like calculating future or past deadlines, follow-up schedules, trial periods, and more.

How It Works:

bfAddOrSubtractDateTime(baseDateTimeStr, amount, calculateUnit, subtract)

Parameters:

NameTypeRequiredDefault valueDescription
baseDateTimeStrstringrequiredtodayThe starting date/time value. This can be given in various date/time formats (e.g., “2025-07-05”, “2025-07-05T10:00”, “14:30:00”, etc.), or you can use “today” to denote the current date.
amountnumberoptional1The amount of time units to add or subtract. This is an integer (you can use a positive number to add time or use the subtract flag to remove time, as described below).
calculateUnitstringoptionaldaysThe unit of time for the amount. Supported values are “seconds”, “minutes”, “hours”, “days”, “weeks”, “months” and “years”. For example, if you want to add 3 weeks, you would set amount = 3 and calculateUnit = ‘weeks’.
subtractbooleanoptionalfalseIf false, the function adds the specified amount to the base date/time. If true, the function subtracts the specified amount from the base date/time. (In other words, setting subtract: true will move the date/time backwards by the given amount.)

Returns:

  • A string representing the new date/time, formatted in the same format as the input was. The function preserves the input format so that the output is easy to work with in the same context:
    • If the input was a full date (e.g. "YYYY-MM-DD" format), the output will be in "YYYY-MM-DD" format.
    • If the input included a time (e.g. "YYYY-MM-DDTHH:mm"), the output will include the time in the same format.
    • If the input was a time-only string (e.g. "HH:mm" or "HH:mm:ss"), the output will be a time string in the same format.
    • If the input was a year-week format (e.g. "2023-W04" for week 4 of 2023), the output will be in "YYYY-Www" format with the week number adjusted accordingly.

Supported input Formats:

Just like bfCalculateDateTimeDifference(), this function supports flexible and dynamic date/time formats:

  • YYYY-MM-DD, YYYY/MM/DD, YYYY.MM.DD
  • YYYY-MM-DD HH:mm, YYYY/MM/DD hh:mm A
  • HH:mm, HH:mm:ss
  • YYYY-MM
  • today
  • now

Examples:

// Add 3 days to today
bfAddOrSubtractDateTime('today', 3, 'days')
// ➜ Returns: "2023-06-21" (if today is 2023-06-18)

// Subtract 2 hours from a timestamp
bfAddOrSubtractDateTime('2023-06-18 14:30', 2, 'hours', true)
// ➜ Returns: "2023-06-18 12:30"

// Add 1 month to a date
bfAddOrSubtractDateTime('2023-01-15', 1, 'months')
// ➜ Returns: "2023-02-15"

Why Use It?

  • Easily calculate future or past dates without manual math
  • Works well for appointment buffers, due dates, reminders, or dynamic ranges
  • Automatically respects and maintains input format
  • Fully compatible with Bit Form’s smart tags and calculated fields

Date/Time Formatter

The bfFormatDateTime() function in Bit Form allows you to format any date or time into a custom display format using flexible tokens, similar to the Flatpickr system. It’s perfect for showing readable dates in emails, PDFs, notifications, or conditional messages.

How It Works:

bfFormatDateTime(dateInput, expectedOutFormat)

Parameters:

NameTypeRequiredDefault valueDescription
dateInputstring/DaterequiredtodayThe input date (can be a date string, JavaScript Date object, or ‘today’)
expectedOutFormatstringoptionalYYYY-MM-DD HH:mmA format pattern string that defines how the output should be structured. Use the tokens (listed below) to specify the format. For example, “MMMM D, YYYY” would output a date like “July 5, 2025”.

Returns:

  • string: A custom-formatted date/time string

Supported Format Tokens:

Here is a formatted list of supported date/time format tokens with descriptions and examples:

📅 Year Tokens

  • YYYY: 4-digit year – 2023
  • yyyy: 4-digit year – 2023
  • YY: Last 2 digits of the year – 23
  • yy: Last 2 digits of the year – 23
  • Y: 4-digit year – 2023
  • y: Last 2 digits of the year – 23

📆 Month Tokens

  • MMMM: Full month name – March
  • MMM: Short month name – Mar
  • MM: Month with leading zero – 03
  • mm: Month with leading zero – 03
  • M: Short form of month name
  • F: Full month name – March
  • n: Numeric month without leading zero (PHP)3
  • m: Numeric month without leading zero – 3

📅 Week Tokens

  • wY: Week of the year (1-53)
  • WY: Week of the year with leading(01-53)
  • wM: Week of the month (1-5)
  • WM: Week of the month with leading Zero (01-05)

📅 Day Tokens

  • DD: Day with leading zero – 05
  • dd: Day with leading zero – 05
  • d: Day without leading zero – 5
  • j: Day without leading zero – 5
  • J: Day with ordinal suffix – 1st
  • D: Short weekday name – Wed
  • l: Full weekday name – Wednesday
  • w: Numeric weekday (Sunday=0) – 3

🕒 Hour Tokens

  • HH: 24-hour with leading zero – 15
  • H: 24-hour – 15
  • hh: 12-hour with leading zero – 03
  • h: 12-hour – 3

⏱️ Minute Tokens

  • II: Minutes with leading zero – 05
  • ii: Minutes with leading zero – 05
  • i: Minutes with leading zero – 05
  • I: Minutes – 5

⏲️ Second Tokens

  • SS: Seconds with leading zero – 09
  • ss: Seconds with leading zero – 09
  • S: Seconds with leading zero – 09
  • s: Seconds – 9

🌓 AM/PM Tokens

  • K: AM/PM – PM
  • A: AM/PM – PM
  • a: am/pm lowercase – pm

🧮 Special Tokens

  • U: Unix timestamp – 1689277200

Examples:

// Basic date formatting
bfFormatDateTime('2023-06-15', 'DD, MMMM dd yyyy')
// ➜ Returns: "Thursday, June 15 2023"

// Time formatting
bfFormatDateTime('14:30:00', 'hh:ii K')
// ➜ Returns: "02:30 PM"

// Custom format with separators
bfFormatDateTime('2023-06-15', 'yyyy/MM-dd at h:K')
// ➜ Returns: "2023/06-15 at 2:PM"

// Ordinal date format
bfFormatDateTime('2023-06-01', 'J MMM yyyy')
// ➜ Returns: "1st Jun 2023"

// Get Unix timestamp
bfFormatDateTime('2023-06-15', 'U')
// ➜ Returns: "1686796800"

Conditional Logic with Repeater Field Calculation. Click Here.

Add Calculation in Bit Form. Click Here.

Share this Doc

Smart Tags

Or copy link

CONTENTS