Identify page/post from which the contact form 7 was sent
In this video, we will learn how to identify the page or post from which the contact form was generated. For that make sure that the contact form is installed on your WordPress website.
Let’s use the contact form on various pages. So copy the code and create two pages. For the first page, name it Contact Page 1. Use the custom HTML to add the shortcode for the contact form and publish it. Then, create another page, Contact Page 2, and add the contact form shortcode and publish it. So you will have Contact Page 1 and Contact Page 2.
From a marketing perspective, it is crucial to determine from which page the contact form was submitted — either Contact Page 1 or 2. To find out, we will use the custom code. Copy and paste the code into the Contact Form 7 and save it. This will add a blank text area to the contact form. If you refresh the page, you can see the field has been added to both pages.
After adding this, go to Mail and in the message body, paste another code. This ensures the field will be included in the email. Now, add the provided code to functions.php. This code fetches the page URL into this text field, allowing us to determine from which page the contact form was submitted.
Now, use the provided CSS to hide the field. Now if the you will know from which the contact from was submitted. This will be very useful in identifying our leads’ page. Thank you very much!
Identify page/post from which the contact form 7 was sent
Create Image Slider for WordPress using CSS and HTML | No Plugin
Create a sitemap using custom code