Fixing a Broken Captcha in Joomla 2.5 and 3

captchaIf you're like me, you have a "captcha" function on your contact form where your users have to type in the squiggly letters to prove that they're human and not spam bots.

This is a good thing. Using Captchas can greatly reduce the amount of spam you receive. This tutorial shows you how to use captchas with Joomla.

However, many of these forms (including mine) stopped working because Google changed the URL used for ReCaptchas.

This is mostly impacting Joomla 2.5 and 3.0+ sites at the minimum. This fix will be included in the next Joomla 3 release but in the meantime, it's not good to have a broken contact form.

I advise you to send a message to yourself from your contact form, if you have one, and see if it's working properly:

  • If you are able to see the squiggly letters in your captcha feature, you're probably fine.
  • If you see the word "captcha" but there are no squiggly letters, your form is probably broken.
  • If you never had captcha installed, you may consider getting one, to save you from some extra spam.

Here's the fix for Joomla 2.5 and 3 sites

The fix is taken from this joomla.org doc.

Go to plugins/captcha/recaptcha/recaptcha.php and change:

  • line 22 (or thereabouts) to the new RECAPTCHA_API_SERVER URL of 'https://www.google.com/recaptcha/api'
  • line 24 (or thereabouts) to the new RECAPTCHA_VERIFY_SERVER URL of 'www.google.com'
  • line 129 (or thereabouts) to the new RECAPTCHA_VERIFY_SERVER value of '/recaptcha/api/verify'

See the change in the next patch: https://github.com/SniperSister/joomla-cms/commit/01e3c84d653c4331f7e11c85aa605426c00bbf6a

You will need FTP access to make this change, or perhaps your hosting control panel has a file manager that lets you edit files. In either case be sure to make a backup of the existing recaptcha.php file before making the recommended edits.