WordPress tutorial – how to install Contact Form 7 with message logging, Google CAPTCHA V2 integration and extra anti-spam measures
Step 1 – install the required plug-ins
- From your WordPress dashboard, go to the plug-ins menu and select ‘add new.’ Search for, install and then activate the following:
Step 2 – integrate the CAPTCHA
Contact Form 7 is a simple plugin that allows you to quickly and easily include contact forms within your WordPress website.
Contact Form 7 also allows you to insert a CAPTCHA into your contact forms to prevent bots from submitting forms and therefore reduce spam. Contact Form 7 utilises Really Simple CAPTCHA as its officially-sanctioned CAPTCHA module.
Insert Headers and Footers is a plug-in that provides you with a is a simple interface allowing you to insert code (like Google CAPTCHA code or Google Analytics) into to your WordPress site header and footer without having to edit your theme files directly.
- Open a new tab in your browser and go to the Google reCAPTCHA site
- Follow the instructions to log in, register your domain and generate a site key and secret key
- Copy the ‘site key’ and ‘secret key’ from the Google site to the Really Simple Captcha integration page before saving
- From within your WORDPRESS dashboard, go to CONTACT > INTEGRATION
- add the site key and secret key in the relevant boxes
- From within your WORDPRESS dashboard, go to SETTINGS > INSERT HEADERS AND FOOTERS
- Paste the script link below into the ‘header’ section then save changes
- From within your WORDPRESS dashboard, go to CONTACT > CONTACT FORMS
- Create a new contact form
- Right before the ‘SEND’ button of your form, paste the code below (don’t forget to add your unique SITE KEY where specified)
- Configure the form fully and save changes
- Create your contact page
- Integrate the contact form as normal within your site
(step 4.1) Paste the following code into the header section
(step 5.2) Paste the following code into your new form just before the ‘send’ button (don’t forget to add your unique ‘site key’)
<div class="g-recaptcha" data-sitekey="<<your unique 'site key'>>"></div>
Step 4 – integrate the HoneyPot
Contact Form 7 Honeypot is a WordPress plugin that adds honeypot anti-spam functionality to Contact Form 7 forms. Honeypot is a technique that adds a hidden field to a form that is essentially a trap set for spambots.
- go to CONTACT and edit your contact form
- within the contact form, before the ‘send’ button tag, use the TAG generator to add a ‘honey pot’ tag
- save the form
Step 5 – activate Akismet
Akismet checks your comments and contact form submissions against their global database of spam to prevent your site from publishing malicious content.
- Go to SETTINGS > AKISMET ANTI-SPAM and follow the instructions to create an account, generate an API key, and activate your site
- Enter the API key, choose your settings, then save changes
Step 6 – test the message log
Flamingo is a message storage plugin for created for Contact Form 7. When any message is sent to you via the contact form, it will also be stored in the Flamingo database allowing you to check for missed or deleted messages.
- test your contact form my sending yourself a message
- once this is working and the message has been received, go to Flamingo from your WordPress site dashboards and view the sent message
If you have any trouble with any of the above instructions, get in touch with us via our main website