By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
horizontal-light horizontal-dark
  • Home
  • Tutorials
    • Salesforce AI
    • Salesforce DevOps
    • Career
    • Errors
    • Interview Questions
    • Salesforce Integration
    • Salesforce Flow
  • Salesforce Tools
  • Apex Development
  • Lightning Web Components
  • Salesforce Admin
  • About
    • Privacy Policy
    • Disclaimer
    • Terms & Conditions
    • Contact
SalesforceCornerSalesforceCorner
Search
  • Home
  • Tutorials
    • Salesforce AI
    • Salesforce DevOps
    • Career
    • Errors
    • Interview Questions
    • Salesforce Integration
    • Salesforce Flow
  • Salesforce Tools
  • Apex Development
  • Lightning Web Components
  • Salesforce Admin
  • About
    • Privacy Policy
    • Disclaimer
    • Terms & Conditions
    • Contact
Follow US
Salesforce Corner » Salesforce Tutorials » Web to Lead Form in Salesforce: Complete Step-by-Step Guide (2026)
Salesforce Tutorials

Web to Lead Form in Salesforce: Complete Step-by-Step Guide (2026)

Set up your Salesforce Web-to-Lead form in minutes and start capturing website leads automatically — no manual entry needed.

Neha Panwar
By
Neha Panwar
ByNeha Panwar
Salesforce Developer and Technical Writer
Neha Panwar is a Salesforce developer and technical writer who creates practical learning resources for Salesforce administrators and developers. She specializes in Salesforce Administration, Apex, Lightning...
Follow:
- Salesforce Developer and Technical Writer
Last updated: 2026/06/21
Share
web to lead form salesforce
SHARE

If you are using Salesforce, collecting leads manually from your website can quickly become inefficient and error-prone.

Every day, potential customers visit your website, fill out contact forms, or send inquiries — and without the right setup, those leads either get lost or require someone to manually enter them into Salesforce.

This is where Web to Lead Form in Salesforce solves everything.

In this complete guide, you will learn what Web-to-Lead is, how it works, and how to set it up step by step — even if you are a complete beginner.

Quick Answer: Web-to-Lead is a free Salesforce feature that automatically creates a Lead record in your org whenever someone submits a form on your website. No manual entry. No missed leads.

Common Problems Without Web-to-Lead {#common-problems}

Before setting it up, let us understand the real problems businesses face without Web-to-Lead.

Contents
Common Problems Without Web-to-Lead {#common-problems}What is Web-to-Lead in Salesforce? {#what-is-web-to-lead}Key Features of Web-to-Lead {#key-features}Fields Available in Web-to-Lead Form {#available-fields}Standard FieldsCustom FieldsSpecial FieldsStep-by-Step: Create Web to Lead Form in Salesforce {#step-by-step}Step 1: Enable Web-to-LeadStep 2: Create the FormStep 3: Generate the HTML CodeStep 4: Add the Form to Your WebsiteStep 5: Test the FormReal World Example {#real-world-example}Common Mistakes to Avoid {#common-mistakes}Best Practices {#best-practices}Limitations of Web-to-Lead {#limitations}Final Thoughts

1. Manual data entry wastes time Sales teams spend hours entering leads received from website forms, emails, and marketing campaigns — time that should be spent selling.

2. Lost leads during high traffic During busy campaigns or events, some leads never get recorded at all. Lost leads mean lost revenue.

3. Data inconsistency Manual entry leads to typos, missing fields, and incomplete information — making your CRM data unreliable.

4. Slow response time The longer it takes to capture a lead, the lower the chance of conversion. Speed matters in sales.

5. No visibility into lead sources Without automated capture, you cannot track which website pages or campaigns are generating the most leads.

All of these problems are solved with a properly configured Salesforce Web-to-Lead form.

What is Web-to-Lead in Salesforce? {#what-is-web-to-lead}

Web-to-Lead is a built-in Salesforce feature that allows you to capture lead information directly from your website into your Salesforce org — automatically.

Here is how it works:

  1. A visitor fills out a form on your website
  2. The form data is sent directly to Salesforce via a hidden endpoint
  3. Salesforce automatically creates a new Lead record
  4. The lead is assigned to the right owner based on your assignment rules
  5. Your sales team gets notified and can follow up immediately

No manual work. No delays. No missed leads.

Related: Want to understand how leads fit into your overall sales process? Read our guide on Lead to Cash Process in Salesforce to see the complete journey from first contact to closed deal.

Key Features of Web-to-Lead {#key-features}

  • Automatically creates Lead records in Salesforce
  • Supports both standard and custom fields
  • Can capture up to 500 leads per day (free)
  • Works with any website — WordPress, Wix, custom HTML
  • Supports Lead Assignment Rules for auto-routing
  • Can be linked to Campaigns for ROI tracking
  • Supports auto-response emails to new leads

Fields Available in Web-to-Lead Form {#available-fields}

You can include different types of fields in your Web-to-Lead form.

Standard Fields

  • First Name
  • Last Name (required)
  • Email
  • Phone
  • Company (required)
  • Lead Source
  • Address details (Street, City, State, Zip, Country)
  • Website
  • Description

Custom Fields

You can also add custom Lead fields to your form:

Setup → Object Manager → Lead → Fields and Relationships → New

Once created, they appear in the field selector when building your Web-to-Lead form.

Special Fields

  • Campaign ID — links the lead to a specific campaign for tracking
  • Record Type — if you use multiple lead record types
  • Currency — if multi-currency is enabled in your org

Related: Learn how leads and contacts differ in Salesforce. Read our guide on Leads vs Contacts in Salesforce to understand when to use each.

Step-by-Step: Create Web to Lead Form in Salesforce {#step-by-step}

Let us go through the complete setup process.

Step 1: Enable Web-to-Lead

  1. Go to Setup (gear icon → Setup)
  2. In the Quick Find box, search “Web-to-Lead”
  3. Click Web-to-Lead
  4. Click Edit and check “Enable Web-to-Lead”
  5. Set a Default Lead Owner (the user who gets leads if assignment rules do not match)
  6. Set a Default Response Template (optional — auto-reply email to the lead)
  7. Click Save

Web-to-Lead is now enabled in your org.

Step 2: Create the Form

  1. On the Web-to-Lead page, click “Create Web-to-Lead Form”
  2. You will see two columns — Available Fields and Selected Fields
  3. Select the fields you want on your form and click Add
  4. Use Up and Down buttons to arrange the field order
  5. Set your Return URL — this is the page users see after submitting the form (e.g., a Thank You page)

Tip: Keep your form short. Only ask for what you truly need. Fewer fields = higher conversion rate.

Step 3: Generate the HTML Code

  1. Click “Generate”
  2. Salesforce generates a complete HTML form with all your selected fields
  3. Copy the entire HTML code

The generated code includes:

  • A hidden oid field (your Salesforce Org ID)
  • A hidden retURL field (your return URL)
  • All selected input fields
  • A Submit button

Step 4: Add the Form to Your Website

  1. Open your website editor (WordPress, Wix, custom HTML, etc.)
  2. Create a new page or open an existing contact page
  3. Paste the HTML code into the page
  4. Publish the page

Your Web-to-Lead form is now live on your website.

For WordPress users: Use a Custom HTML block in Gutenberg, or paste inside an Elementor HTML widget.

Step 5: Test the Form

Before going live with real traffic, always test:

  1. Open your website form
  2. Fill in all fields with test data
  3. Click Submit
  4. Go to Salesforce and open the Leads tab
  5. Check if a new Lead record was created with your test data

If the lead appears — your setup is working perfectly.

Tip: Use a unique email address for testing so you can easily find the test lead in Salesforce.

Real World Example {#real-world-example}

Let us compare what happens with and without Web-to-Lead.

Situation: A user visits your website and fills out a “Request a Demo” form.

StepWithout Web-to-LeadWith Web-to-Lead
Form submittedGoes to email inboxInstantly creates Lead in Salesforce
Data entrySomeone manually types it inAutomatic — zero manual work
Response timeHours or daysInstant notification to sales rep
Data accuracyRisk of typosExactly as typed by the user
Lead trackingDifficultFull history in Salesforce
Campaign trackingNot possibleLinked to Campaign automatically

The difference is clear — Web-to-Lead saves time, reduces errors, and speeds up your entire lead process.

Common Mistakes to Avoid {#common-mistakes}

1. Not enabling Web-to-Lead first The feature must be enabled in Setup before you can create the form. Many beginners skip this step.

2. Missing required fields Last Name and Company are required by Salesforce. If they are missing from your form, lead creation will fail silently.

3. No spam protection Without protection, bots can flood your org with fake leads. Add Google reCAPTCHA to your form to block spam submissions.

4. Not setting a Return URL Without a Return URL, users see a blank Salesforce page after submitting. Always set a proper Thank You page URL.

5. Not testing before going live Always test with real data before sending traffic to your form. A broken form means lost leads.

6. Ignoring the 500 leads per day limit If you expect high volume during a big campaign, plan ahead. For higher volumes, consider the Salesforce API.

Best Practices {#best-practices}

  • Keep the form simple — only ask for essential fields
  • Always add spam protection with reCAPTCHA
  • Set up an auto-response email so leads know you received their inquiry
  • Link forms to Campaigns to track which campaign generated the lead
  • Use Lead Assignment Rules to route leads to the right sales rep automatically
  • Set up a proper Thank You page as your Return URL
  • Use Salesforce Flow to trigger follow-up tasks when a new lead is created
  • Test the form thoroughly before publishing

Related: Once leads start coming in, you need a process to handle them. Read our guide on Salesforce Flow Tutorial for Beginners to automate your lead follow-up process.

Limitations of Web-to-Lead {#limitations}

LimitationDetail
Daily limitMaximum 500 leads per day
CustomizationBasic HTML form — limited styling options
ValidationBasic only — no complex field validation
Spam protectionNot built-in — must add reCAPTCHA manually
High volumeFor 500+ leads per day, use Salesforce API instead

For advanced needs — such as complex forms, conditional fields, or high-volume capture — consider using the Salesforce REST API or a third-party form tool like Formstack or 123FormBuilder.

Final Thoughts

Setting up a Web to Lead Form in Salesforce is one of the quickest wins you can get as a Salesforce Admin or Developer.

In just a few steps, you go from manual, error-prone lead entry to a fully automated system where every website visitor who shows interest is instantly captured in your CRM.

The result:

  • No more lost leads
  • Faster response times
  • Cleaner, more accurate data
  • Better visibility into your lead sources

If you have not set this up yet — do it today. It takes less than 30 minutes and the impact on your sales process is immediate.

Next Steps: Now that your leads are flowing into Salesforce automatically, learn what to do with them. Read our guide on Leads vs Contacts in Salesforce to understand when and how to qualify and convert your leads.

Also Read:

  • salesforce apex
  • Salesforce Flow Tutorial for Beginners
  • lwc component
  • Types of Salesforce Integrations

Last Updated: May 2026 | Category: Salesforce Tutorials

TAGGED:lead generation salesforcesalesforce adminsalesforce formssalesforce lead captureweb to lead salesforce
Share This Article
Facebook Email Print
ByNeha Panwar
Salesforce Developer and Technical Writer
Follow:
Neha Panwar is a Salesforce developer and technical writer who creates practical learning resources for Salesforce administrators and developers. She specializes in Salesforce Administration, Apex, Lightning Web Components (LWC), Flow, integrations, and automation. Through Salesforce Corner, she publishes step-by-step tutorials, coding guides, and real-world solutions designed to help readers understand Salesforce concepts and apply them in projects with confidence.
Leave a Comment Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Latest Post

Salesforce Escalation Rules
Salesforce Escalation Rules: A Complete Guide
Salesforce Admin
Salesforce Case Assignment Rules
Salesforce Case Assignment Rules: Queues, Sort Order, Catch-All Rules, &Troubleshooting
Salesforce Admin
Salesforce Approval Process
Salesforce Approval Process: Classic Setup vs New Flow Approvals — Which Should You Use?
Salesforce Admin
Master-detail vs lookup comparison
Master-Detail or Lookup? Choosing the Right Relationship in Salesforce
Salesforce Admin
salesforce dynamic forms infographic design 6a67003704e5f
Salesforce Dynamic Forms: A Better Way to Show and Hide Fields
Salesforce Flow

Stay Updated with Salesforce Tutorials

Get the latest Salesforce guides, tutorials, and developer tips delivered to your inbox.
slaesforce corner mascot

Explore More Topics

  • salesforce admin
  • salesforce developer
  • Salesforce Admin
  • salesforce tutorial
  • salesforce automation
  • Salesforce Development
  • salesforce apex
  • Apex Development
  • salesforce security
  • lightning web components
  • Lightning Web Components
  • salesforce lwc
  • Salesforce Tutorials
  • Salesforce Tools
  • salesforce best practices
horizontal-dark-transparent

Learn Salesforce development with practical tutorials, Apex guides, integration examples, and real-world solutions for developers.

  • Quick Links:
  • About
  • Contact
  • Privacy Policy
  • Disclaimer
  • Terms & Conditions
Facebook Twitter Youtube Linkedin-in

Salesforce Corner © 2026

Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?