Spam Guard harnesses the power of Akismet to fight Spam
Switch branches/tags
Clone or download
selvinortiz Merge pull request #11 from engram-design/master
Add support for Comments plugin
Latest commit de5f2d7 Apr 9, 2016

Spam Guard

Spam Guard 0.6.0

Lovingly crafted by Selvin Ortiz for Craft CMS

Spam Guard harnesses the power of Akismet to fight Spam


  1. Proven Spam Fighting capabilities with the help of Akismet
  2. Native support for the Contact Form Plugin
  3. Native support for the Guest Entries Plugin
  4. Native support for the Sprout Forms
  5. Clean and efficient codebase with good documentation
  6. Friendly developer support via Github, Twitter, and via email at


  1. Download the Official Release
  2. Extract the archive into your craft/plugins directory
  3. Install Spam Guard from the control panel @ Settings > Plugins
  4. Add your API Key and Origin URL
  5. Enable support for Contact Form and/or Guest Entries


If you are upgrading to version 0.6.0 from an earlier version, please see the documentation for Guest Entries because the way hidden fields in your form are defined has changed.

  1. Spam Guard now expects the following fields spamguard[emailField|authorField|contentField]
  2. The values for those fields should now be wrapped in curly braces match entry field handles


Please note that Guest Entries requires Craft 2.0 or above

Contact Form Usage

To fight spam coming from your contact form, you must do the following...

  1. Follow the Contact Form setup guide if you haven't already
  2. Make sure Contact Form support @ Settings > Plugins > Spam Guard

That is it, all future submissions will be monitored by spam guard ;)

Guest Entries Usage

To fight spam coming from your guest entry form, you must do the following...

  1. Follow the Guest Entries setup guide if you haven't already
  2. Make sure Guest Entries support is enabled @ Settings > Plugins > Spam Guard
  3. Add the hidden input fields to your form so Spam Guard knows what to validate

Hidden Input Fields

Add the following fields to your guest entry form.

<input type="hidden" name="spamguard[emailField]" value="{guestEntryEmailFieldHandle}">
<input type="hidden" name="spamguard[authorField]" value="{guestEntryFullNameFieldHandle}">
<input type="hidden" name="spamguard[contentField]" value="{guestEntryBodyFieldHandle}">

These fields need to be defined so that Spam Guard knows what attributes to look for in the guest entry in order to prepare the data to pass along to Akismet for validation.

When the form is submitted and the Guest Entry is validated, the entry will be handed to Spam Guard which will then grab the spamguard[emailField|authorField|contentField] values containing twig placeholders which will then be replaced by attribute values found in the EntryModel

Note that the emailField and authorField are not required!

Sprout Forms Usage

Sprout Forms support is implemented in the same way support is implemented for Guest Entries, the directions for Guest Entries should be followed.


All noteworthy changes are listed on the official changelog


If you have any feedback or questions, please reach out to me on twitter @selvinortiz


  • Huge thanks to the WordPress/Akismet team for their great efforts and service they provide.
  • Special thanks to @themccallister for testing Spam Guard and for providing valuable feedback.


Spam Guard is open source software licensed under the MIT license

Open Source Initiative