Get Useful Marketing Data From Contact Form 7

By Gordon Smith

If you use WordPress, there’s a strong chance you also use Contact Form 7 for your online forms.

But did you know that you can add some useful marketing information to Contact Form 7 emails without any programming?

Most people use the form-to-email capability of Contact Form 7 to ensure that when a form is filled in by a user, a copy is sent to the site admin by email.

Well, those emails can be formatted and configured in some really useful ways – including adding useful context and marketing info.

For example, if you have a form that appears on multiple pages, it’s really handy to know which page it was submitted on. Here’s how:

In the “Mail” settings of your Contact Form, you can type in the following codes, which magically transform themselves into useful info:

  • [_post_title] will transform itself into the title of the page or post the user was on.
  • [_url] will give the URL (web address) of the page the user was on.
  • [_remote_ip] transforms into the IP address of the user at the time they submitted the form.
  • [_date] transforms into the date they submitted the form.
  • [_time] gives the time.

Now, combining these shortcodes can give some really handy data.

For example you can copy and paste the following to give some handy information about the date/time and page complete with a clickable hyperlink to go to look up the IP address on ip2location.com (a very handy IP address lookup service) and another clickable link to take you to the page where the form was submitted.

This form was submitted on [_date] at [_time].
The page was <a href="[_url]">[_post_title]</a>
The user's IP address was <a href="https://ip2location.com/[_remote_ip]">[_remote_ip]</a>. 

(Make sure you tick the “Use HTML content type” on the form to ensure this works properly).

When you receive your email, it will have the marketing information included like this:

Form submission

There are lots of other built-in shortcodes for Contact Form 7. The list is here: https://contactform7.com/special-mail-tags/

Tip 1: to translate an IP address into usable information about the user, go to https://ip2location.com and type in the IP address there.
Tip: it is NOT advisable to include such shortcodes on