How to enable captcha for frontend, backend and contact us form in Magento

1

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:

  1. Enable catcha for frontend (checkout, login, register)
  2. Enable captcha for backend (use for admin login page, prevent auto-logging)
  3. 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

captcha magento front end

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.

captcha magento front end 1

Enable CAPTCHA for Backend

To enable CAPTCHA for backend, you can navigate to System -> Configuration -> Advanced section -> Admin -> CAPTCHA

captcha magento back end

 

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

captcha magento back end 1

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.

enter magento extension key

 

After the installation is done, go to System> Configuration> General> Contacts> Contacts Form Captcha. Now you will see the new extension as below

contact us captcha magento

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.

contact us captcha magento 2Conclusion

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.

 

Rate this post

Share.

About Author

Daniel is a Magento developer with 5 years of experience with customizing Magento extensions, Magento templates. He's main author at Magento explorer

1 Comment

  1. Thank you, I follow your tutorial and successfully installed the reCaptcha on my Magento store running on Magento 1.9

Leave A Reply