<p>I have a confession to make: <em>I hate captcha</em>. But on the other hand, spam is one of the most frustrating issues ever. So with that being said, I am a big fan of <a href="http://haacked.com/archive/2007/09/11/honeypot-captcha.aspx">Honeypot Captcha</a>.</p>

<p>I couldn’t find any ExpressionEngine addons that added honeypot captcha functionality for both the comment form and the <a href="http://www.solspace.com/software/detail/freeform/">Freeform</a> module, so I decided to go ahead and create one.</p>

<h2>Basic Functionality</h2>
<p>This extension validates the EE comment form and Freeform forms to make sure a field that is hidden with CSS is left empty.</p>

<h2>Getting Started</h2>
<ul><li><a href="https://github.com/davist11/Hon-ee-Pot-Captcha">Download Hon-ee Pot Captcha</a></li>
  <li>Unzip the folder and copy the <em>honeepot</em> folder into your /system/expressionengine/third_party/ directory.</li>
  <li>Go to Add-ons → Extensions and “Enable extension”.</li>
  <li>You can customize the field name for the honey pot field and the message a user receives if the field is filled in by going to the extension settings.</li>
</ul><h3>Setup</h3>
<p>In the Freeform module, go to Fields → Create a New Field. Now create a field with the field name matching the field name in the Hon-ee Pot Captcha settings. The default is <em>honeepot</em>.</p>

<p>Now in your form, add the honey pot field:</p>

<pre>&lt;li class="screen-reader"&gt;
  &lt;label for="honeepot"&gt;Don't put anything here&lt;/label&gt;
  &lt;input type="text" name="honeepot" id="honeepot" /&gt;
&lt;/li&gt;</pre>

<p>In my CSS, I have a class to move things off of the page:</p>
<pre>.screen-reader {
  display: block !important;
  left: -9999px !important;
  position: absolute !important;
  top: -9999px !important;
}</pre>

<p>You can add the same form field to your comment forms as well.</p>

<h2>That is all</h2>
<p>Hopefully this addition will help to combat some of the spam contact form submissions and comments (even though they get caught by <a href="http://loweblog.com/software/low-nospam/">Low NoSpam</a>). You can <a href="https://github.com/davist11/Hon-ee-Pot-Captcha">download the Hon-ee Pot Captcha extension on Github</a>. Let me know if you run into any issues.</p>