Articles - Posts

Expert Authors Sharing Knowledge
Download .pdf...

Say Goodbye to CAPTCHA

By J.C. Hurst

*Files that include this technique can be downloaded below the article.

Anti-Spam techniques like CAPTCHA interfere with a visitor filling out a form. This results in a decrease in lead conversions, especially when visitors are using their mobile devices.

A much better Spam fighting method is called the 'Honey-pot Technique'.

When Spam Bots target a form, they fill out every element and submit the form while ignoring CSS. We can exploit this trait to combat Spam Bots without frustrating site visitors.

This technique uses an empty text element named "business" that must remain empty during the submit process, or the form will be identified as Spam and will not be sent. The element is only visible to Spam Bots, not human site visitors. The download includes a simple form on an HTML page, (contact-us), that posts to a PHP form-mailer, (contact-send.php), that sends the visitor to a 'Success' page if the form is sent, (success). The form mailer uses PHP code, not Java-script, to confirm that the "business" element is empty.

Setting up the form:

On the form, just above the 'Submit' element, create a DIV with the class 'business':

<div class="business"></div>

Inside the DIV, create a text element named 'business' with a label that reads: "Business * (If you are human LEAVE THIS BLANK)". (The label will be readable by disabled visitors using screen readers):

<div class="business">
<label for="business">"Business * (If you are human LEAVE THIS BLANK)</label">
<input type="text" name="business" value="">

Now we'll use CSS to get the entire DIV out of our way. Place the following style information at the top of the page in the HEAD section:

<style type="text/css">
.business {

Setting up the php-mailer:

Before using 'contact-send.php' you'll need to edit the following 3 lines near the top of the page around line 20:

  1. email_to = "";
  2. email_from = "";
  3. email_subject = "Contact Us Form -";

Just above those 3 lines you'll see the following code that checks the incoming "business" element:

// Form handling - Form checking honey-pot
if ( $_POST['business'] != '' ) {

die("There was an error");

} else {

I sincerely hope this solution will help you to eliminate mail form Spam without creating an inconvenience for your site visitors.

Download Files

Web Design
Graphic Design
Digital Marketing

Supporting Veterans

Supporting Veterans

Veteran Owned Business

Slide Backgrounds

Slide Backgrounds

Slide Backgrounds

Email Templates

Email Templates

Email Templates