3 Easy Steps To Prevent Contact Form Spam With reCAPTCHA
Everyone hates those annoying images that ask you to identify words, places or numbers when submitting a website form but if you own a website you'll also know how annoying it is getting contact form spam.
The programs that ask you to identify images are called CAPTCHA and are used to distinguish human input from bots.
Well, Google has come to our rescue and developed a simple replacement called the 'No CAPTCHA reCAPTCHA', the reCaptcha requires only a finger tap or the click of a mouse.
It might sometimes ask you to identify images but these are normally easier to see and look something like the below image.
The great news is that it's really easy to set up 'No CAPTCHA reCAPTCHA' on your website, you can do it by following these 3 simple steps.
Part 1: Request an API key
You will need a Google account(gmail), once you have an account you will need an API key. Click here to get an API key.
You’ll be asked for a label(just give it any name that suits you) and enter your website.
Part 2: Using the API key
You will now be given a site key and a secret key.
On your contact form add this java-script to the head tag
Copy the reCAPTCHA widget and paste it into your contact form.
Your form should look something like the below contact form
Part 3: Checking the recaptcha with PHP
Your submit page should look something like the below:
Replace YOUR SECRET KEY with your secret key.
Thanks for reading.
If you're interested in having your website updated then why not get a FREE website mock up.
Get A FREE Mock Up