Filter Out Spam Leads in Salesforce

We use to manage our customer relationships and we’ve been happy with the application since we began using it in early 2007. Over the last year we’ve noticed a growing problem with lots of spam submissions from our Web-to-Lead forms creating bogus leads in our instance.

How to Filter Out Spam Leads in Salesforce

To combat this problem, we wrote a simple validation rule that checks for a couple of very common spam techniques. If a new lead submitted via a Web-to-Lead form meets the validation rule conditions, the lead is not created and an email is sent to the regular recipients of leads with the lead information. If the lead is legitimate you can then manually create the lead in

To create a validation rule to combat spam, use the following procedure. The rule simply checks to see if the first and last name are the same (assuming Sirhan Sirhan isn’t trying to contact you!) or if the first name, last name or description fields contain the string “http://”. That’s it and it works quite well. Give it a shot!

  1. Log into your instance.
  2. Click your name in the upper-right corner and select Setup.
  3. Navigate to App Setup > Customize > Leads > Validation Rules.
  4. Click New to create a new validation rule.
  5. Set the Rule Name to Spam_Bots.
  6. Set the Error Condition Formula to the following:
    FirstName == LastName 
    CONTAINS(FirstName, ‘http’) 
    CONTAINS(LastName, ‘http’) 
    CONTAINS(Description, ‘http’)
  7. Set the Error Message to something like “No go buddy! You’re a spammer!” and this text will appear in the email sent when a lead is not created.
  8. Set the Error Location to Top of Page.
  9. Save the Validation Rule.
  10. Test the rule by entering “spam-ish” data into your Web-to-Lead form. For example, enter “” as the first name, last name or description. You should see that the lead is not created and that an email is sent with the lead information.

Comments are closed.

Sign in
Forgot password?
Sign up

(*) Required fields

I agree with OptimaSales Terms & Privacy Policy