ecently Google has released a new version for their free service reCAPTCHA. The new reCAPTCHA checkbox is easier to use for the “real” visitor and provides a strong validation feature. With the new checkbox it’s not necessary to enter a combination of random letters and numbers to submit some comment form. I tried the new reCAPTCHA checkbox and must say it’s a great replacement, because the widget looks better and as mentioned before: there is no more challenge you have to enter.
The last is not completely true, while testing, I’ve discovered that you have to enter a challenge if service think you’re a spammer. There is also a fallback feature for old browsers, where the user has to enter 1) a challenge and 2) has to copy/paste some response code. This advanced tutorial shows you how to integrate the new reCAPTCHA checkbox into the WordPress comment system.
Add the new reCAPTCHA checkbox to your comment form
The function is used as a WordPress filter to check the request from the reCAPTCHA API before the comment is processed or stored inside the database. This way of comment validation is very secure, because each request is done together with the users IP address. The IP address validation will check that this IP address is the same as the one that was recorded at the moment the user has clicked the checkbox before. These are hard times for every spambot. This integration for your WordPress comment section is very basic and is written for the native comment feature provided by WordPress. If you use an Ajax comment form, it’s maybe necessary to change the code a bit. For my own WordPress websites I use the AVH First Defense Against Spam plugin instead of a CAPTCHA challenge, but I created a reCAPTCHA example demo to show how it works.