Skip to content


WordPress Tip #6 – Tracking form submissions with Contact Form 7

I was recently asked to set up a WordPress site, with a contact form which could be placed into any page or post.

No problem, the Contact Form 7 plugin lets me set up a contact form, and gives me a handy shortcode which I can use to insert the form anywhere within a page or post.

BUT, they also wanted to know which page the form was submitted from, so that they could track their leads, and send relevant information based on which page the user filled out the form on.

Now, I wasn’t aware of any obvious way to do this, without hacking the form, so I had a look at the Contact Form 7 documentation.

It took me a while to find, but there are some special mail tags you can add into your message body, to collect more detailed information about the form submission.

To collect the URL of the page where the form was submitted, you just need to paste [_post_url] into the message body of your contact form.

How to collect the post URL with Contact Form 7

How to collect the post URL with Contact Form 7

There are several other special mail tags you can use if you want to collect more details, such as post author, post date or sender’s IP address.

Let me know if you found this useful.

Posted in Editorial Pick, General, Web, Web Design.

Tagged with , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.