How to Add Google reCAPTCHA to Joomla Contact Forms
- by Naveen Kumar
- on Tutorials
Are you looking to integrate Google reCAPTCHA into your Joomla contact form?
Spammers are finding new ways to spam your website with massive spam attacks with little effort. So it becomes necessary to fight with them and save your Joomla site from the spammers.
So in this tutorial, we will learn how to integrate Google reCAPTCHA with your Joomla contact form. There are lots of Joomla form builders available in the market so it will not be possible for me to use all of them but we will use the native Joomla Contact Form, JD Simple Contact Form, and Covert Forms in this article.
What is Google reCAPTCHA?
reCAPTCHA is a free service from Google which helps you to protect your website from spammers. It is a rebranded technology of CAPTCHA which was acquired by Google in 2009.
It is a technology which is used to differentiate between humans and a robot.
When you integrate Google reCAPTCHA on your website form, it asks users to perform an action before submitting the form. It basically showcases a checkbox and the user has to check that in order to prove himself if it is a human or a robot. Sometimes, it asks for a match with the images.
Google offers you two types of reCAPTCHA.
- CAPTCHA - reCAPTCHA.
- CAPTCHA - Invisible reCAPTCHA (It is supported with Joomla 3.x+ versions)
Google has made reCAPTCHA publicly available, so that website owners can use it on contact forms, login pages, and registration pages to reduce spam.
Integrating Google reCAPTCHA with Joomla Contact Form
To integrate Google reCAPTCHA, first of all, you need to activate the CAPTCHA - reCAPTCHA or CAPTCHA - Invisible reCAPTCHA plugin on your website and then you need to register your website on Google to get the reCAPTCHA API key.
Get Google reCAPTCHA API Key
As mentioned above, you need to register your domain with Google ReCaptcha in order to get the API key.
To get the API keys, head over to the Google reCAPTCHA website and click on the ‘Get Started’ button located at the top right corner of the screen.
Now, register your website here by clicking on the Plus (+) placed on the top right side. Once you click on it, you will be redirected to the next screen as shown in the screenshot.
Enter all the required details here and click on the submit.
As soon as you click on the Submit button, you will get your Site Key and the Secret Key on your screen.
Configure CAPTCHA Plugins
Joomla comes with two separate system plugins for CAPTCHA - reCAPTCHA and CAPTCHA - Invisible reCAPTCHA. By default, they are set to disabled. So you need to enable them.
To enable, navigate to Extensions > Plugins, search for Captcha.
You will get both of the plugins. If you want to use both, you can simply enable the plugin and add the API keys.
Now, select the plugin you want to use and open it and configure the Site and Secret keys here along with other settings.
Once done, save and close it.
Adding reCAPTCHA to Joomla Contact Form
In the previous step, you have enabled and configured the Google reCAPTCHA plugin. Now let's integrate it within the Joomla Contact form.
Joomla already has a contact form. So we will use that in our first configuration.
Navigate to System > Global Configurations > Site tab.
Look for the Default Captcha named field. Select the type of CAPTCHA here. As I have configured CAPTCHA - reCAPTCHA, so I will select the same here also.
Once selected, save and close it.
Now, navigate to Component > Contact > Options.
Go to the Form tab and look for the field named Allow Captcha on Contact and either select Use Global or any other CAPTCHA which you want.
Once done, save and close it. Voila! you have successfully integrated Google reCaptcha within the Joomla Contact form.
Now, we will see how easy it is to integrate with third-party Joomla form builder extensions.
Integrating Google reCAPTCHA with JD Simple Contact Form
JD Simple Contact Form is a free Joomla contact form builder from team JoomDev. If you are looking for a little bit advanced and lightweight Joomla form builder, JD Simple Contact Form is what you need.
You can download this module from JoomDev's official website and install it on your Joomla website. Once installed, follow the steps.
Note: To enable Google reCAPTCHA, you will need to enable the plugins and configure them with the reCAPTCHA API key.
Create a New Module
To create a JD Simple Contact Form module, navigate to Extensions > Module. Click on New and look for JD Simple Contact Form from the module types.
Click on it and you will be directed to the module creation page. Give the title to the module and create your Joomla form. To create the form, you can have a look at its tutorial.
Now, under the module tab, look for the Enable Captcha field.
Simply click on the Yes. Voila! you have successfully added reCaptcha to your contact form. It supports both the captchas.
Integrating Google reCAPTCHA to Convert Forms
Convert Forms is another easy-to-use and advanced form builder developed by Tassos Marinos. You can create any kind of form such as contact form, booking form, travel request form, or any other kind of form for your Joomla website and integrate them with Zapier, email service providers, etc.
The extensions come with free and paid versions. So you can try with the free version and if you need advanced functionalities, you can go for the premium version. So download the extension from the official website and install it on your Joomla website.
Once done with the installation, move to the next steps.
Create your first form
To create a form in Convert Forms, navigate to Components > Convert Forms. Now, you are on the dashboard. Click on the New Form button and start creating your form.
You can have a look at this tutorial if you are facing any issues in creating your form.
Configure Google reCAPTCHA API Key
Register your domain to Google reCAPTCHA and get your API key as explained above in this article.
Once you have the Site and Secret key, navigate to Global Configurations > Convert Form. Look for the reCaptcha tab.
Add the keys here in the respective fields.
Adding reCAPTCHA in the form
Now, select the form where you want to add the reCAPTCHA and edit it.
Look for the reCAPTCHA and reCAPTCHA-Invisible field types under the Advanced Fields.
Add the field to the form and make necessary changes as per your needs.
Now, you are done.
This is how you can add Google reCAPTCHA to the Joomla form and protect your website from spammers.
Feel free to comment down if you have any questions or tips to improve this article.