How To Use Akismet With Contact Form 7

by Meghan . updated July 23, 2020 . 1 shares .

Do you have a problem with spammers attacking your website’s contact form? In today’s tutorial, I am going to teach you how to use Akismet with Contact form 7 to prevent spam from arriving in your inbox.

Akismet is a spam filtering tool made by the creators of WordPress. Akismet’s primary task is to rid your comments of spam which are usually submitted automatically by spambots.

As well as dealing with comment spam Akismet can also be used to filter text entered into a contact form.

Contact Form 7 is one of the most popular contact form plugins. Fortunately, you can quite easily configure it to communicate with Akismet and rid your contact form submissions of spam as well as your comments.

If you are unfamiliar with Contact Form 7, it is a free plugin available in the WordPress repository. It is one of the most popular contact form plugins with more than five million active installations.

Why use Akismet with Contact Form 7?

We now know that Akismet is a spam filtering service, and Contact Form 7 is a WordPress plugin that can allow you to embed a contact form on your WordPress site.

When you put anything on your site where the public can submit text, then you open up your website to spammers

Adding a captcha is one way to deal with spam. A captcha is a way of forcing users to prove they are human by asking them to decipher some text. The latest captchas (Recaptcha v3 by Google), can detect if the user is not behaving like a human, and ask them to complete a task to prove their humanity.

The problem with captchas is that they can put off your users from completing a contact form, plus some captchas can slow down your website.

Akismet does not slow down your website loading time, and it doesn’t annoy anyone. It’s effective at stopping spam, plus, it’s free to use for non-commercial sites. The paid plans are quite reasonable.

How to Use Akismet with Contact Form 7

Step 1 – Install Akismet and Contact Form 7 plugins

If you don’t already have Akismet and Contact Form 7 installed on your WordPress site, go to Plugins->Add New and search for Akismet and then Contact Form 7. If you are not sure how to install plugins in WordPress, see this guide.

Step 2 – Setup Akismet

Before you can use Akismet, you need to go through a process of registering with the service.

After you activate the plugin, you should see this message at the top of the plugins screen.

Setup your akismet account message

If you don’t see the above message click the settings link on the plugins screen instead:

Akismet spam settings link

If you already have an API key enter it on the next screen, otherwise, click ‘Get your API key‘ to go to the Akismet site to create your keys.

You must have a account to create Akismet keys. If you already have an account, login or sign up for a new one.

Akismet spam settings screen

Once you have logged into Akismet with your account, the next step is to select a plan.

One of the options is Name Your Price, where you can choose how much you would like to pay, the lowest price is zero. The free plan is meant only for non-commercial sites.

Select akismet plan

When you have selected a plan, the activation screen should display as below.

Akismet activate this site screen

Click Activate this site, then you should arrive back at your WordPress settings screen, and the Akismet key should be filled in.

You can then make some option changes to the settings.

I recommend you select the first option for ‘Strictness‘ – ‘Silently discard the most pervasive spam‘, and the first option again for ‘Privacy‘ – ‘Display a privacy notice‘.

Then save your changes.

Akismet complete settings screen

Step 3 – Create a Contact Form

If you don’t already have a contact form set up, create one now by going to Contact->Add New. Or you can start with the default form that is added when you install the plugin (Contact form 1).

Step 4 – Integrate Akismet and Contact Form 7

To connect Akismet and Contact Form 7, open up your form and add the text akismet: (including the colon) in front of one of the field names.

For example, if you have a field called your-name replace the text with akismet:your-name.

You only need to do this on one field, and in so doing the plugin, will filter the whole contact form data through Akismet when the user clicks the submit button.

Here is an example:

Akismet and contact form 7 integration

Step 5 – Test it is working

The last step is to test it is working, and you can do that by entering some spammy text into the form.

Open up the page where you embedded the contact form.

If you don’t have it working anywhere yet, you will need to add the shortcode to a page, as listed at the top of the configuration screen for your form. It will be something like [contact-form-7 id=”xxx”].

Before you do this test, it is a good idea to test the form works normally first. Check you can enter valid data and get a success message back when you click the submit button.

Assuming all was well, we can now test with some spam text.

Type something spammy into any of the text fields such as in name field or message field. An example of some spam text is viagra-test-123.

Submit the form, and you should get an error message back, this indicates that the message was thrown out by the Akismet filter.

Frequently asked questions on how to use Akismet with Contact Form 7

What is the alternative to Akismet?

Antispam Bee is an excellent alternative to Akismet. It is free and straightforward to set up. However, it doesn’t work with Contact Form 7. You would need to use a recaptcha or a honeypot to catch spam on your forms instead.

Final thoughts on how to use Akismet and Contact Form 7

Setting up Akismet with Contact Form 7 is a straightforward task. The task would be even easier if it were just a case of ticking a checkbox or have it automatically detect that Akismet is running. Nevertheless connecting Akismet and Contact Form 7 isn’t difficult to achieve.

On the whole, Akismet is a pretty accurate service, but it can never be 100% right.

The developers of Contact Form 7 recommend that you also install a plugin called Flamingo to collect the form data. That way, you can keep an eye on what messages arrive in spam, and it should help you pick up any false positives or negatives.

Do you have any questions on how to use Akismet and Contact Form 7? Please ask below.

Did you love this article? Please share it if you did!

This post was proofread by Grammarly

  • Good call on Flamingo – well worth adding for CF7, not only for viewing spam IP address etc but also as backup of all submitted forms – handy if your host’s email goes down or you misplace the emailed form…

    I’ve used the Honeypot on a few sites and it never seemed to stop much spam. Google v3 Recaptcha has worked great for me but the statistics and reporting are nowhere near as good as Akismet – very hard to check for false positives.

    Funny that business owners often moan about paying for Akismet, even though it’s very cheap compared to the amount of time wasted reading spam emails! For personal blogs it’s free so it’s a no-brainer 😉

    Worth noting that the reason for the ‘privacy notice’ option is that Akismet sends form submissions to their own servers for analysis – sites in EU should choose that for GDPR compliance.

    What do you think about US sites – is the privacy notice needed to comply with CCPA in California? I guess it makes sense to choose it anyway, just in case?

  • wow… thanks for the advice. I was using a captcha form but I was still getting problems and it was also slowing down the website as mentioned. So any way followed your steps and install Akismet on one of my wordpress sites and I feel freeeee! Thank you so much Meghan. Great post.

  • >

    Our website uses cookies and thereby collects information about your visit to improve our website, show you Social Media content and relevant advertisements. Please see our privacy page for further details or agree by clicking the 'Accept' button.

    Cookie settings

    Below you can choose which kind of cookies you allow on this website. Click on the "Save cookie settings" button to apply your choice.

    NecessaryOur website uses functional cookies. These cookies are necessary for our website to work and to keep it secure. They do not identify you as a user in any way.

    AnalyticalOur website uses analytical cookies to make it possible to analyze our website and optimize for the purpose of a.o. the usability.

    Social mediaOur website places social media cookies to show you 3rd party content like YouTube and Facebook. These cookies may track your personal data.

    AdvertisingOur website places advertising cookies to show you 3rd party advertisements based on your interests. These cookies may track your personal data.

    OtherOur website places 3rd party cookies from other 3rd party services which aren't Analytical, Social media or Advertising.