Troubleshooting
Stay organized with collections
Save and categorize content based on your preferences.
Important: Version 1.0 of the reCAPTCHA API is no longer supported, please upgrade to Version 2.0. Learn more
-
I Can't Work Out Where to Add reCAPTCHA
-
This advice applies to everyone who's integrating reCAPTCHA -- irrespective of language.
Firstly you need to identify two hot spots in your code. These are
the places where you'll be adding the reCAPTCHA calls.
Display reCAPTCHA: The first hot spot is the code that generates the form. Hopefully
that's easy enough to find (by looking for a <form> tag in your html) and you have been able to display the
CAPTCHA on your form.
Check reCAPTCHA: The second hot spot is the one that seems to cause people problems. You need to identify the
code that handles form submission -- that is the code that runs when the user clicks on submit. It's hard to generalize
about what this code looks like but here are some clues that may help you:
- if your form can ever display an error message, for example if a required field is blank, look for the code that generates
that error message.
- if your form places information in a database look for code that does a SQL INSERT.
- if your form sends mail, search for the code that does that.
Life will be easier if your form already has some validation logic (i.e.
it handles invalid input from the user by displaying a
message instead of performing whatever action it normally would).
If that's the case and you can find the code that does that you're
nearly home free. If the form can display an error message search
for the text of the error message within the code and you're sure
to be close. Once you've found the validation code you need to add a call to
the check_answer function in addition to whatever other checks are there
(email address blank? age too young? etc.).
If there's currently no validation logic for your form -- if clicking on submit always succeeds -- then you
have a more tricky problem. In that case you'll have to add the reCAPTCHA validation code right before the existing
form handling code does whatever it does when the user submits. You'll also have to figure out how to redisplay the
form to give the user another attempt at the captcha. Unfortunately there's no one stock answer to how you do that. It
depends entirely on the structure of the code you already have. If the existing code isn't too complex you may have
luck posting it on the reCAPTCHA developer forum and asking
for advice. (If you do post there, be sure to include enough information for others to help you; simply saying "my code
doesn't work" usually doesn't yield good results.)
-
It's Not Working! Help!
-
Before doing anything else make sure you're using the correct keys. Are your public and private keys swapped? Did
you remember to put the private key in the form handler as well as putting the public key in the form?
Note that Mailhide uses different keys from the main form-based reCAPTCHA.
Be sure that your form uses the POST method, or else change the reCAPTCHA form handler variables to GET instead of POST.
If reCAPTCHA was working and you suddenly start getting "An internal error occurred",
did you recently delete the Google account that you used to sign up for the keys? If so, register
for new keys with an active account and try those.
-
reCAPTCHA is Accepting Incorrect Words
-
Humans make errors and we understand that. In reCAPTCHA we use an advanced risk analysis engine
to determine whether the incoming request is from a human or not. When we are highly confident that
users are human, we allow them to make small mistakes.
-
No, I Mean *Totally* Incorrect Words
-
If reCAPTCHA is accepting any input whatsoever, you probably aren't correctly validating the reCAPTCHA answer
with the API servers. That is, either: (1) you are not correctly calling
https://www.google.com/recaptcha/api/verify
(or the equivalent function if you're using a plugin, such
as recaptcha_check_answer
in PHP), or (2) you are not taking the appropriate action
given the response from our servers. Please see the specific instructions that you used to install reCAPTCHA
(whether it be through a plugin or not) to learn how to check whether the user entered the answer correctly.
-
My Users Are Starting To Get One Word Captchas
-
reCAPTCHA is not always about two words. It is a test to tell human and robots apart. In cases
where we have high confidence that you are human, we will serve you a much easier captcha (sample
below). Our system relies on your entire engagement with reCAPTCHA -- before, during, and after
solving it -- to decide if you pass or fail the test, rather than on the solution alone.
If you are curious about the security of these easy captchas, please refer to our blog:
http://googleonlinesecurity.blogspot.com/2013/10/recaptcha-just-got-easier-but-only-if.html
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003ereCAPTCHA API Version 1.0 is no longer supported; users must upgrade to Version 2.0.\u003c/p\u003e\n"],["\u003cp\u003eTo integrate reCAPTCHA, identify the code generating your form to display the reCAPTCHA and the code handling form submission to check the user's response.\u003c/p\u003e\n"],["\u003cp\u003eIf reCAPTCHA is not working, ensure you are using the correct public and private keys, the form uses the POST method, and your Google account is active.\u003c/p\u003e\n"],["\u003cp\u003ereCAPTCHA's advanced risk analysis engine may allow for minor errors in word recognition when confident the user is human.\u003c/p\u003e\n"],["\u003cp\u003ereCAPTCHA uses varying difficulty levels, including single-word captchas, based on user interaction and confidence in human behavior.\u003c/p\u003e\n"]]],["reCAPTCHA API version 1.0 is deprecated; users should upgrade to version 2.0. Integrating reCAPTCHA involves two key actions: displaying the reCAPTCHA within the form and checking the reCAPTCHA answer upon form submission. Ensure the correct public and private keys are used, and forms use the POST method. If incorrect answers are accepted, validation with the API servers might be missing or improperly handled. One-word captchas indicate high confidence in the user being human, based on their engagement with reCAPTCHA.\n"],null,["# Troubleshooting\n\n**Important** : Version 1.0 of the reCAPTCHA API is no longer supported, please upgrade to Version 2.0. [Learn more](/recaptcha/docs/faq)\n\n- [I Can't Work Out Where to Add reCAPTCHA](#wheretoadd)\n- [It's Not Working! Help!](#notworking)\n- [reCAPTCHA is Accepting Incorrect Words](#incorrectwords)\n- [No, I Mean \\*Totally\\* Incorrect Words](#reallyincorrectwords)\n- [My Users Are Starting To Get One Word Captchas](#onewordcaptchas)\n\n*** ** * ** ***\n\n\nI Can't Work Out Where to Add reCAPTCHA\n\n: This advice applies to everyone who's integrating reCAPTCHA -- irrespective of language.\n\n Firstly you need to identify two **hot spots** in your code. These are\n the places where you'll be adding the reCAPTCHA calls.\n - **Display reCAPTCHA:** The first hot spot is the code that generates the form. Hopefully\n that's easy enough to find (by looking for a \\\u003cform\\\u003e tag in your html) and you have been able to display the\n CAPTCHA on your form.\n\n - **Check reCAPTCHA:** The second hot spot is the one that seems to cause people problems. You need to identify the\n code that handles form submission -- that is the code that runs when the user clicks on *submit*. It's hard to generalize\n about what this code looks like but here are some clues that may help you:\n\n - if your form can ever display an error message, for example if a required field is blank, look for the code that generates that error message.\n - if your form places information in a database look for code that does a SQL INSERT.\n - if your form sends mail, search for the code that does that.\n\n #### Form Already Has Validation\n\n Life will be easier if your form already has some validation logic (i.e.\n it handles invalid input from the user by displaying a\n message instead of performing whatever action it normally would).\n If that's the case and you can find the code that does that you're\n nearly home free. If the form can display an error message search\n for the text of the error message within the code and you're sure\n to be close. Once you've found the validation code you need to add a call to\n the check_answer function in addition to whatever other checks are there\n (email address blank? age too young? etc.).\n\n #### Form Has No Validation\n\n If there's currently no validation logic for your form -- if clicking on submit **always** succeeds -- then you\n have a more tricky problem. In that case you'll have to add the reCAPTCHA validation code right before the existing\n form handling code does whatever it does when the user submits. You'll also have to figure out how to redisplay the\n form to give the user another attempt at the captcha. Unfortunately there's no one stock answer to how you do that. It\n depends entirely on the structure of the code you already have. If the existing code isn't too complex you may have\n luck posting it on the [reCAPTCHA developer forum](http://groups.google.com/group/recaptcha) and asking\n for advice. (If you do post there, be sure to include enough information for others to help you; simply saying \"my code\n doesn't work\" usually doesn't yield good results.)\n\n\nIt's Not Working! Help!\n\n: Before doing anything else make sure you're using the correct keys. Are your public and private keys swapped? Did\n you remember to put the private key in the form handler as well as putting the public key in the form?\n\n Note that Mailhide uses **different keys** from the main form-based reCAPTCHA.\n\n Be sure that your form uses the POST method, or else change the reCAPTCHA form handler variables to GET instead of POST.\n\n If reCAPTCHA was working and you suddenly start getting \"An internal error occurred\",\n did you recently delete the Google account that you used to sign up for the keys? If so, register\n for new keys with an active account and try those.\n\n\nreCAPTCHA is Accepting Incorrect Words\n\n: Humans make errors and we understand that. In reCAPTCHA we use an advanced risk analysis engine\n to determine whether the incoming request is from a human or not. When we are highly confident that\n users are human, we allow them to make small mistakes.\n\n\nNo, I Mean \\*Totally\\* Incorrect Words\n\n: If reCAPTCHA is accepting any input whatsoever, you probably aren't correctly validating the reCAPTCHA answer\n with the API servers. That is, either: (1) you are not correctly calling\n `https://www.google.com/recaptcha/api/verify` (or the equivalent function if you're using a plugin, such\n as `recaptcha_check_answer` in PHP), or (2) you are not taking the appropriate action\n given the response from our servers. Please see the specific instructions that you used to install reCAPTCHA\n (whether it be through a plugin or not) to learn how to check whether the user entered the answer correctly.\n\n\nMy Users Are Starting To Get One Word Captchas\n\n: reCAPTCHA is not always about two words. It is a test to tell human and robots apart. In cases\n where we have high confidence that you are human, we will serve you a much easier captcha (sample\n below). Our system relies on your entire engagement with reCAPTCHA -- before, during, and after\n solving it -- to decide if you pass or fail the test, rather than on the solution alone.\n\n If you are curious about the security of these easy captchas, please refer to our blog:\n \u003chttp://googleonlinesecurity.blogspot.com/2013/10/recaptcha-just-got-easier-but-only-if.html\u003e"]]