Contact Form 7 is one of my favorite contact form plugins. However, I am not a fan of using reCAPTCHA and I am less of a fan of Contact Form 7’s implementation. This is because it loads the service on all pages. To avoid the bloat and headache of reCAPTCHA we are going to be integrating Akismet with Contact Form 7.
First Off, Why Should You Do This?
As we covered in our post about how reCAPTCHA is killing your website performance, the alternative is slow. Akismet delivers virtually no payload while being very effective and reducing spam.
You also get the benefit of improved user experience as you don’t need to worry about users having to click random photos if flagged. It’s a 100% invisible solution that is faster than the alternative which is truly a win for everyone involved.
I’m Sold How Do I Set It Up?
To setup the functionality make sure you have Akismet installed and there is a valid api key. This is in addition to Contact Form 7 being installed, now keep in mind you will need to do these below steps for all forms. (for those using a lot of different fields I apologize for what you’re going to have to go through.
Step 1: Looking at our options
You see, not every field will need modification but there are three types of fields that can be modified. However, even if only one field is modified all data will be taken into account when trying to prevent spam. So, therefore the following Akismet options exist for Contact Form 7.
You only need to include one of the options in your form for spam filtering to be enabled.
Step 2: Integrating Into Your Form
To integrate any of the above options open up one of your forms in the plugin. If you have a field for their name you would want to add it like the following.
[text* your-name akismet:author]
Effectively all you need to do is append the field with any of the above akismet integrations. Keep in mind you will want to integrate the akismet option with a respective field that makes sense. If you place the akismet:author_url in the your name field it could lead to undesirable results.
Contact Form 7 is a really well designed plugin and the integration with Akismet only proves it. While some annoyances with the plugin do crop up such as the Refill code it enables if you’re using any form of page caching.