Stop Spam On Your Website By Implementing Google reCAPTCHA PHP Script

A friend of mine complained to me about him getting lots of spam messages and replies in his forum website. He said not only are they annoying, but contain adult and porn links. I decided to implement a simple captcha to help fight spam using google reCAPTCHA.
If you are in same problem, follow the steps below to code and implement a captcha to help fight spam in your website.

  1. Head over to google reCAPTCHA page
  2. Sign up by submitting your website URL
  3. You will be given a public and private key
  4. Downlnad the google reCAPTCHA here
  5. Extract the recaptchalib.php and upload to the root folder of your site
  6. Next to do is implementing the captcha in your site as outline below:-
    • Add the below code to your html <form>


      Don’t forget to set $publickey by replacing your_public_key_here with your API public key.

    • Next, we need to add the below code in our html form file (verify.php).

      Also make sure your form is set to get the form variables using $_POST, instead of $_REQUEST, and that the form itself is using the POST method.

If you have done the steps above successfully, congratulation! You won’t be haunted again by spam.
If you encounter difficulties implementing this or have any contribution to make, i will be glad to hear your comments.

About Agbonghama Collins

Agbonghama Collins is a webdeveloper and an internet geek. I love writing and sharing the little idea & information i know. Hope you enjoyed my Article.

Follow me on Twitter, add him on Facebook or on Google+

  • lastdon02

    Gud job bt guy sum people day buypass dat tin o shay u no?

  • collizo4sky

    It can be bypassed. Google reCAPTCHA is used by facebook, twitter, yahoo etc to stop spam.

  • Tayomi

    Nice one. Time to implement dis on ma new script.