How to install Contact Form 7 with a CAPTCHA in WordPress
Contact Form 7 is a great choice when it comes to including a contact form in your WordPress website, however, it can be a bit fiddly when extending the functionality to include a CAPTCHA. Here is a simple guide to installing Contact Form & with a CAPTCHA and message log:
- Install and activate the following plug-ins:
- From within your WORDPRESS dashboard, go to CONTACT > INTEGRATION
- Open a new tab in your browser and go to the Google reCAPTCHA site
- Follow the instructions to register your domain and generate the site and secret keys
- 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 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
(step 4.1) Paste the following code into the header section
<script src='https://www.google.com/recaptcha/api.js'></script>
(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>