Code for adding URL into Contact Form 7 for WordPress


After setting up a contact form, using CONTACT FORM 7 for one of my websites, I realised that I needed to know which page the replies were coming from, so in my first attempt, I requested them to copy and past from the URL bar.  Easy enough for some, but not everyone knows what a URL bar is.

Then I searched around and saw some pretty complex ways of doing it, and I do mean complex!!

But in the end, hidden in a small comment, I saw this [_url]

So, in the message body of the form I was making I just added [_url] at the bottom of the form, and tested the contact email, and lo and behold, I got the sending page URL at the bottom of the incoming email.

This is my final message body layout, with the URL now moved to the top:

From: [your-name] <[your-email]>
Subject: [your-subject]
URL [_url]

Message Body:

Name: [Name]
Address: [Street-Address]
Suburb: [Suburb]
Phone: [Phone]

IP: [wpcf7.remote_ip]


This mail is sent via…

The IP:[wpcf7.remote_ip] part, shows the submitters IP address, from which you can check their real location at sites such as www.maxmind.com or check if that IP is a common spammer source at sites like: www.stopforumspam.com

Please let me know if this helps you.


533.1 - 806,501
DreamHost

Scroll down for Comments
0 0 votes
Article Rating
Subscribe
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

2 Comments
Inline Feedbacks
View all comments

This is wonderfull. I have the same “problem” with the url. And it works fine.
Thanks for sharing this.

Regards

You’re my hero! I was looking for this, and I tried coding myself, but failed.After an hour of suffering, I found your site and very simple solution which is not in the FAQ plugin. Thanks a lot

2
0
Would love your thoughts, please comment.x
()
x