For security reason, sometimes you want to enable Captcha in frontend, backend or contact us form in Magento (using recaptcha) to prevent spam.
In this Magento tutorial we will learn how add captcha to Magento front end, backend and contact us from.
We will go through 3 sections:
- Enable catcha for frontend (checkout, login, register)
- Enable captcha for backend (use for admin login page, prevent auto-logging)
- Enable captcha for contact form page (prevent auto submission/spam)
Enable CAPTCHAÂ for frontend
Magento has built-in captcha for Frontend, you can enable it by navigating to System > Configuration > Customers > Customer Cunfiguration
Next, Select Yes for field Enable CAPTCHA on Frontend. There are a number of options here for frontend CAPTCHA.
- Font: specify font you want to use, leave it default
- Form: Select where you want CAPTCHA to be displayed  on Frontend, hold CRT or SHIFT to multi-select.
- Displaying Mode: Make CAPTCHA always displayed or only after a number of fail attempts to login.
- Timeout: Captcha timeout, users will need to enter another CAPTCHA after a period of time.
- Number of Symbols: Number of Symbols using in CAPTCHA
- Symbols Used in CAPTCHA: Specify which text you want to use for random CAPTCHA generation
- Case Sensitive: CAP Letter or Case-sentive letter
Now clear cache and go to front-end to check if the CAPTCHA is displayed.
Enable CAPTCHA for Backend
To enable CAPTCHA for backend, you can navigate to System -> Configuration -> Advanced section -> Admin -> CAPTCHA
Similarly, you can config Captcha here
After you’re done with the configuration, remember to flush cache and go to backend section to check if the CAPTCHA is displayed correctly
Enable CAPTCHA for contact page
Enabling Captcha on contact page is a a little bit complicated. If you are a Magento developer, you can refer this document. Since this is a tutorial for Magento beginners, I suggest you to use a free Magento module to integrate Captcha to Contact Page.
Download the module
You can download the module in Magento connect at:
http://www.magentocommerce.com/magento-connect/contacts-form-captcha.html
Install the module
You can install the module by getting its extension key on Magentoconnect and insert it in System > Magento Connect and click install.
After the installation is done, go to System> Configuration> General> Contacts> Contacts Form Captcha. Now you will see the new extension as below
You can signup for an new account at http://www.google.com/recaptcha to acquire public and private keys
Now flush cache and go to contact us page to see if the CAPTCHA is displayed correctly.
Conclusion
Captcha is very necessary for your Magento store as there are many automated tool for hacking websites. I hope this tutorial help you enhance your Magento store’s security by adding some captcha to specific pages. If you have any questions, just drop a line below and I will reply in no time.
1 Comment
Thank you, I follow your tutorial and successfully installed the reCaptcha on my Magento store running on Magento 1.9