How to integrate Google’s No CAPTCHA reCAPTCHA to your website

Step 1: Register your website on Google reCAPTCHA

To start the process, you need to register your website on Google reCAPTCHA. Go to and add your website.
You will be returned a set of keys like something below.

Site key
Use this in the HTML code your site serves to users.
Secret key
Use this for communication between your site and Google. Be sure to keep it a secret.

Step 2: Adding the code to your website

Google's no captcha reCAPTCHA

$recaptcha_secret = "6Lc4-YYYYYYYYYY-YYYYYYYYYY";
        <title>Google reCAPTCHA Demo</title>
        <form method="post" action="index.php">
            Enter your website: <input type="text" name="website" id="website" placeholder="" required /> <input type="submit" value="Submit">
            <div class="g-recaptcha" data-sitekey="<?php echo $site_key; ?>"></div>

        <script src=''></script>

        //verify captcha
        $response = file_get_contents("".$recaptcha_secret."&response=".$_POST['g-recaptcha-response']);
        $response = json_decode($response, true);
        if($response["success"] === true)
            //not a robot
            //you are a robot

Say Hello! Don’t be shy.