ShahiLanding

How to Integrate Contact Forms

This step-by-step tutorial shows you how to add and integrate contact forms with your ShahiLandin landing pages.

What You’ll Learn

By the end of this tutorial, you’ll know how to:

    1. Add HTML forms to landing pages
    2. Integrate Contact Form 7
    3. Integrate Gravity Forms
    4. Integrate WPForms
    5. Connect forms to email marketing
    6. Track form conversions
    7. Time Required: 10-20 minutes
      Difficulty: Beginner to Intermediate
      Prerequisites: Published landing page

      Method 1: Basic HTML Form

      The simplest approach for basic forms.

      Step 1: Create HTML Form

      Edit your landing page and add this HTML:

      `html

      Get Your Free Guide


      `

      Step 2: Set Up Form Backend

      Choose a form processing service:

      Option A: Formspree (Free & Easy)

    8. Visit formspree.io
    9. Sign up for free account
    10. Create new form
    11. Copy your form endpoint: https://formspree.io/f/abc123xyz
    12. Replace in your form’s action attribute
    13. Option B: FormSubmit (No Signup Required)

      Replace form action with:
      `html

      `

      Emails will be sent to your@email.com.

      Option C: Custom PHP Handler

      If your host supports PHP, create form-handler.php:

      `php
      SERVER[“REQUESTMETHOD”] == “POST”) {
      $name = striptags(trim($POST[“name”]));
      $email = filtervar(trim($POST[“email”]), FILTERSANITIZEEMAIL);
      $phone = striptags(trim($POST[“phone”]));
      $message = trim($_POST[“message”]);

      $to = “you@yourdomain.com”;
      $subject = “New Lead from Landing Page”;
      $email_content = “Name: $name\n”;
      $email_content .= “Email: $email\n”;
      $email_content .= “Phone: $phone\n\n”;
      $email_content .= “Message:\n$message\n”;

      $headers = “From: $name <$email>“;

      if (mail($to, $subject, $email_content, $headers)) {
      header(“Location: /thank-you”);
      } else {
      echo “Error sending email.”;
      }
      }
      ?>
      `

      Update form action: action="/form-handler.php"

      Step 3: Add Success Message

      Add JavaScript for better UX:

      `html

      `

      Method 2: Contact Form 7 (Recommended)

      Most popular WordPress form plugin – free and powerful.

      Step 1: Install Contact Form 7

    14. Go to Plugins → Add New
    15. Search for “Contact Form 7”
    16. Click Install Now
    17. Click Activate
    18. Step 2: Create a Form

    19. Go to Contact → Contact Forms
    20. Click Add New
    21. Enter form name: “Landing Page Lead Form”
    22. Step 3: Design Your Form

      Default form template:
      `

      [submit “Send”]
      `

      Customize for landing page:
      `
      [text* your-name placeholder “Your Name”]

      [email* your-email placeholder “Your Email Address”]

      [tel your-phone placeholder “Phone Number (optional)”]

      [checkbox your-consent uselabelelement “I agree to receive marketing emails”]

      [submit class:cta-button “Get My Free Guide”]
      `

      Step 4: Configure Email Settings

      Click Mail tab:

      To: you@yourdomain.com
      From: [your-name] <[your-email]>
      Subject: New Lead from Landing Page: [your-subject]
      Message Body:
      `
      From: [your-name] <[your-email]>
      Phone: [your-phone]
      Consent: [your-consent]

      Message:
      [your-message]


      This e-mail was sent from a contact form on YourSite (https://yoursite.com)
      `

      Click Save.

      Step 5: Add Form to Landing Page

    23. Copy the shortcode: [contact-form-7 id="123" title="Landing Page Lead Form"]
    24. Edit your landing page
    25. In HTML editor, add where you want the form:
    26. `html

      Get Started Today


      `

      Step 6: Style the Form

      Add to CSS editor:

      `css
      / Contact Form 7 Custom Styles /
      .wpcf7 {
      max-width: 600px;
      margin: 0 auto;
      }

      .wpcf7 input[type=”text”],
      .wpcf7 input[type=”email”],
      .wpcf7 input[type=”tel”],
      .wpcf7 textarea {
      width: 100%;
      padding: 15px;
      margin-bottom: 15px;
      border: 1px solid #ddd;
      border-radius: 5px;
      font-size: 16px;
      }

      .wpcf7 input[type=”submit”] {
      background: #0066cc;
      color: white;
      padding: 15px 40px;
      border: none;
      border-radius: 5px;
      font-size: 18px;
      cursor: pointer;
      width: 100%;
      }

      .wpcf7 input[type=”submit”]:hover {
      background: #0052a3;
      }

      .wpcf7-not-valid-tip {
      color: #ff0000;
      font-size: 14px;
      }

      .wpcf7-response-output {
      border: 2px solid #00a000;
      background: #e6ffe6;
      padding: 15px;
      margin-top: 15px;
      border-radius: 5px;
      }
      `

      Step 7: Track Form Submissions

      Add conversion tracking:

      `html

      `

      Method 3: Gravity Forms (Premium)

      Professional forms with advanced features.

      Step 1: Install Gravity Forms

    27. Purchase from gravityforms.com
    28. Download plugin
    29. Go to Plugins → Add New → Upload Plugin
    30. Upload and activate
    31. Enter license key
    32. Step 2: Create Form

    33. Go to Forms → New Form
    34. Enter form name: “Landing Page Lead Capture”
    35. Drag and drop fields:
    36. – Name (required)
      – Email (required)
      – Phone
      – Message (paragraph text)
      – Submit button

      Step 3: Configure Notifications

    37. Click SettingsNotifications
    38. Edit Admin Notification:
    39. Send To: your@email.com
      Subject: New Lead: {Name:3}
      Message: Use merge tags to include form data

      Step 4: Set Up Confirmations

    40. Click SettingsConfirmations
    41. Choose confirmation type:
    42. Text: Show success message
      Page: Redirect to thank you page
      Redirect: External URL

      Example text confirmation:
      `
      Thank you for your interest! Your free guide has been sent to {Email:4}.

      We’ll also follow up with you shortly.
      `

      Step 5: Add to Landing Page

      Copy shortcode: [gravityform id="1" title="false" description="false"]

      Add to landing page HTML:
      `html

      Get Your Free Consultation


      `

      Step 6: Custom Styling

      `css
      / Gravity Forms Custom Styles /
      .gform_wrapper {
      max-width: 600px;
      margin: 0 auto;
      }

      .gform_wrapper input[type=”text”],
      .gform_wrapper input[type=”email”],
      .gform_wrapper input[type=”tel”],
      .gform_wrapper textarea {
      width: 100% !important;
      padding: 12px !important;
      border: 1px solid #ddd !important;
      border-radius: 5px !important;
      }

      .gformwrapper .gformbutton {
      background: #ff6600 !important;
      color: white !important;
      padding: 15px 40px !important;
      border: none !important;
      border-radius: 5px !important;
      font-size: 18px !important;
      }

      .gformwrapper .validationerror {
      background: #ffe6e6;
      border: 2px solid #ff0000;
      padding: 15px;
      border-radius: 5px;
      }
      `

      Step 7: Track Conversions

      Add to functions.php:

      `php
      addaction(‘gformaftersubmission1′, function($entry, $form) {
      if (issingular(‘shahilanding’)) {
      ?>

      `

      Method 4: WPForms (Freemium)

      User-friendly drag & drop form builder.

      Step 1: Install WPForms

    43. Go to Plugins → Add New
    44. Search “WPForms”
    45. Install WPForms Lite (free) or WPForms (premium)
    46. Activate
    47. Step 2: Create Form

    48. Go to WPForms → Add New
    49. Select template: Simple Contact Form or Newsletter Signup
    50. Drag fields from left panel:
    51. – Name
      – Email
      – Phone
      – Message

    52. Click Save
    53. Step 3: Configure Settings

      General:

    54. Form Name: “Landing Page Lead Form”
    55. Submit Button Text: “Get Started”
    56. Notifications:

    57. Send To Email: your@email.com
    58. Email Subject: New Lead from {field_id=”1″}
    59. Confirmation:

    60. Type: Message or Page redirect
    61. Message: “Thanks! Check your email for the guide.”
    62. Step 4: Add to Landing Page

      Copy shortcode: [wpforms id="123"]

      `html

      Download Your Free Guide

      `

      Step 5: Custom Styling

      `css
      / WPForms Custom Styles /
      .wpforms-container {
      max-width: 600px;
      margin: 0 auto;
      padding: 40px 20px;
      }

      .wpforms-field input[type=”text”],
      .wpforms-field input[type=”email”],
      .wpforms-field input[type=”tel”],
      .wpforms-field textarea {
      width: 100%;
      padding: 15px;
      border: 1px solid #ddd;
      border-radius: 5px;
      font-size: 16px;
      }

      .wpforms-submit {
      background: #28a745 !important;
      color: white !important;
      padding: 15px 40px !important;
      border: none !important;
      border-radius: 5px !important;
      font-size: 18px !important;
      width: 100%;
      }

      .wpforms-confirmation-container {
      background: #d4edda;
      border: 2px solid #28a745;
      padding: 20px;
      border-radius: 5px;
      text-align: center;
      }
      `

      Step 6: Track Conversions

      `html

      `

      Connecting to Email Marketing

      Mailchimp Integration

      With Contact Form 7:

    63. Install Contact Form 7 Mailchimp Extension
    64. Go to form settings → Mailchimp tab
    65. Connect account and select list
    66. Map form fields to Mailchimp fields
    67. With Gravity Forms:

    68. Install Gravity Forms Mailchimp Add-On
    69. Settings → Mailchimp → Connect account
    70. In form settings → Mailchimp → Create feed
    71. Map fields
    72. With WPForms:

    73. WPForms → Settings → Integrations
    74. Mailchimp → Click Add Connection
    75. Enter API key
    76. In form builder → Settings → Mailchimp
    77. Convert Kit Integration

      Similar process – install addon for your form plugin.

      Custom API Integration

      Add to landing page:

      `html

      `

      Multi-Step Forms

      For complex lead capture.

      Example: 3-Step Form

      `html

      Step 1: Tell us about yourself


      Step 2: Your goals


      Step 3: Contact info


      `

      Best Practices

      Form Design Tips

    78. Keep it short: 3-5 fields maximum
    79. Clear labels: Tell users what to enter
    80. Required fields only: Don’t ask for unnecessary info
    81. Strong CTA: “Get My Free Guide” not “Submit”
    82. Mobile-friendly: Large tap targets, easy to fill
    83. Privacy assurance: “We’ll never spam you”
    84. Visual hierarchy: Make important fields prominent
    85. Conversion Optimization

    86. Remove navigation (Canvas mode)
    87. Single focused goal
    88. Social proof near form
    89. Urgency/scarcity
    90. Benefit-focused copy
    91. Trust badges
    92. Testing Checklist

      Before launching:

    93. ✅ Test form submission
    94. ✅ Verify email received
    95. ✅ Check on mobile
    96. ✅ Test validation errors
    97. ✅ Confirm thank you message
    98. ✅ Track conversion in analytics
    99. Summary

      You’ve learned how to:

    100. ✅ Add basic HTML forms
    101. ✅ Integrate Contact Form 7
    102. ✅ Integrate Gravity Forms
    103. ✅ Integrate WPForms
    104. ✅ Connect to email marketing
    105. ✅ Track form conversions
    106. ✅ Style forms for landing pages
    107. ✅ Create multi-step forms
    108. Your landing pages now capture leads effectively!

      Related Tutorials

    109. How to Set Up Conversion Tracking
    110. How to Create Your First Landing Page
    111. How to Run A/B Tests

Need Help? Contact support or check documentation.

Share this article

Was this article helpful?

Help us improve our documentation

Still need help?

Our support team is ready to assist you with personalized guidance for your workspace.

Submit a support ticket