Websites that use forms will need to be secured from spamming by "Spam-Bots". Spam-Bots will visit your site and fill out forms that are not secured. This can result in comment spamming in forums, spam emails being sent from your server, and other spam related activities. Google has what's called "reCAPTCHA" that allows you to add an image with a special code to your forms. This requires the person filling in and submitting the form to type the code correctly before the form can be submitted.

When setting up web forms in Content Management Systems like Drupal, Wordpress, Joomla, Moodle, and others, you will need to have 2 keys created for your reCAPTCHA to work. ReCAPTCHA requires a public and a private key in order for the code to function in your web forms. These are free to get from Google if you have a Gmail account. The following will explain how to get a free reCAPTCHA key from Google.

Generating a public and private reCAPTCHA key

  1. Log into your Google account.

    Important! If you do not have a Google account, you will need to sign up for a Gmail account. You can do this for free here.

  2. Search for Google reCAPTCHATo find the reCAPTCHA site, type "Recaptcha" in Google search.

    You should see a link that says "reCAPTCHA: Stop Spam, Read Books". Select that link and you should be directed to the following:

    https://www.google.com/recaptcha


  3. Click Use Google reCAPTCHAOn the reCAPTCHA page, click "Use reCAPTCHA ON YOUR SITE".
  4. Sign up for Google reCAPTCHAClick "Sign up Now!".
  5. Create keys Google reCAPTCHAType your domain you are using the reCAPTCHA for. Select the "Enable this key on all domains (global key)" so you can use the same reCAPTCHA key for all your sites.

    Click Create Key.


    Google reCAPTCHA public and private keysGoogle will have 2 keys generated for your site, a public and a private key. These are the reCAPTCHA keys you will use in your Software.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-07-09 5:30 am

Thanks... :)

n/a Points
2014-08-07 6:40 am
Hey come on.... its awesome already.. you are rocking mate... keep going...
PS:
make this as a link ( https://www.google.com/recaptcha ) not a text.. :)
Staff
9,576 Points
2014-08-14 10:16 am
Thanks for letting us know about the link. It has been corrected.
n/a Points
2014-08-14 10:03 am

Is it possible to get keys for an IP address instead of a Domain?

Staff
9,576 Points
2014-08-14 10:13 am
Yes, it is indeed possible. Simply enter the IP instead of the domain.
n/a Points
2014-08-21 1:38 pm

thanks..........

n/a Points
2014-11-05 3:58 am

I did all these step but captcha is not visible

Staff
17,873 Points
2014-11-05 11:00 am
Hello Zeeshan,

Sorry to hear that you're having problems with the Captcha. However, we do need more information in order to provide you assistance. Can you please provide your domain name, any error messages, and the steps you've taken to set up the recaptcha?

Also, make sure that you have clear your browser cache before reviewing the page. This may help to prevent you from seeing an old cached page.

Otherwise, please send us more information and we would happy to look into the issue further for you.

Regards,
Arnel C.
n/a Points
2014-11-05 4:36 pm

@Arn: Since hours I try to find a solution for the same problem: Input error: k: Format of site key was invalid :(

I read a lot of descriptions+youtube-videos, but I didn't find a solution. Maybe you can help me?!

On this site is my code: blackbox030.com

And like this looks my varify.php (without keys, but public is at public and private at private - sure!

 <?php

  require_once('recaptchalib.php');

  $privatekey = "my_private_key_like_acqjhnp9fzqp...";

  $resp = recaptcha_check_answer ($privatekey,

                                $_SERVER["REMOTE_ADDR"],

                                $_POST["recaptcha_challenge_field"],

                                $_POST["recaptcha_response_field"]);

 

  if (!$resp->is_valid) {

    // What happens when the CAPTCHA was entered incorrectly

    die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .

         "(reCAPTCHA said: " . $resp->error . ")");

  } else {

    // Your code here to handle a successful verification

  }

  ?>

PS: I found nearly a solution. I had the reCaptcha already, but it directed me to another page 'verify.php' But I don't want to change my page. Is it possible?

Staff
17,873 Points
2014-11-05 4:55 pm
Hello Yoshi,

Sorry for the problem you're seeing. The error message you're reporting has been seen by others as well. The best documentation I saw on resolving it can be found here. Please review this post and let us know if it resolves your problem.

Regards,
Arnel C.
n/a Points
2014-11-26 1:01 pm
Question: does registration of a web site for recaptcha mean that the registration itself becomes publicly visible? That could be kinda sticky if you're trying to keep web site ownership anonymous.
Staff
17,873 Points
2014-11-26 1:30 pm
Hello Fromage,

Thanks for the question. Registration for recaptcha has nothing to do with domain privacy, so there would be no issue. Also, bear in mind that per ICANN rules, a registrar will maintain a record of the actual owner of the domain. Depending on the privacy service, the actual owner's name may not be shielded by the domain privacy service. You can tell by looking at a WHOIS query. ICANN is the governing body for internet domain names.

I hope this information helps to clarify the matter. If you have any further questions, please let us know.

Regards,
Arnel C.

n/a Points
2014-11-26 1:59 pm

I'm fully aware of domain privacy w.r.t. anon registration.  The domain in question is anonymized, and only the registrar is information is public, the real ownership is hidden by the registrar.  No issue there.  The issue here is that the google registration for captcha will associate a google id with a domain at google.  I'm unable to find a statement on whether google considers that information confidential (subject to court order etc. etc. etc.) or whether it's freely accessible to everyone.

Staff
17,873 Points
2014-11-26 2:06 pm
Hello Fromage,

Thanks for the reply. As far as I know, the information provided by registration of Recaptcha is not information that is available to the general public. If you want to be absolutely clear, you will need to contact Google for that particular information. I looked to see if there was anything explicit on the subject, but the only thing that might be related is the Privacy policy link that Google provides. Apologies that I can't provide you a more specific answer.

Regards,
Arnel C.
n/a Points
2014-11-26 2:51 pm

I was hoping someone more familiar with this would have spotted it somewhere int he documentation.  Thanks for the try.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

15 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!