Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

ReCaptcha and Page Comments

Go to End

2 Posts   2235 Views


Community Member, 141 Posts

7 January 2009 at 7:35pm

I have had to disable Akismet on my site because it simply doesn't work at the moment (after 60 seconds I get an execution time exceeded error message). MathSpamProtection is enabled for now. However, it would be pretty easy to write a script that could parse the equation and enter the solution. It's probably only a matter of time before some spammers do this, and render it useless.

There is a ReCaptcha module, but has anyone connected it to the general page comment? For that matter, the documentation of this module is prety slim.



Community Member, 57 Posts

2 February 2010 at 4:26pm

Edited: 02/02/2010 4:27pm

I have implemented ReCaptcha and works OK using SS 2.3.3. You need to install both ReCaptcha and SpamProtection modules together. Then run the /dev/build parameters in the URL and you will have the "Spam Protection drop down field for UserForms and if you turn on page comments, it will display the ReCaptcha image as well.

Please note that you have to register for a ReCaptcha key at their site, so that you can get a public and private key assigned to you, which you have to incorporate into your _config.php in the 'mysite' folder. See instructions at:

You also need to add a line of code inthe _config.php file in the 'mysite' folder. See instructions at:

This is my code in my _config.php:

// Spam Protection Setup - 'recaptcha' & 'spamprotection' modules
RecaptchaField::$public_api_key = '<publickey>';
RecaptchaField::$private_api_key = '<privatekey>';

Copy and paste it into your _config.php and replace the items <publickey> & <privatekey> with your keys generated from the ReCaptcha site. To register and get your key for ReCaptcha, go to:

I have implemented this using 'olivesunset' & 'blackcandy' themes and they work fine. However, on my 'highground' theme, the ReCaptcha image block is a bit screwed up. i.e. too many line spaces in between the ReCaptcha code. See: I think it has something to do with the line height of the CSS for this theme. I am still to find a solution for it.