First time here? Check out the FAQ!

"Input error: k: Format of site key was invalid" when reCAPTCHA is turned on

I had reCAPTCHA turned on in /settings/EXTERNAL_KEYS/ on my hosted site, but when people went to create new accounts, they saw the following instead of the reCAPTCHA interface:

Please read and type in the two words below to help us prevent automated account creation.
Input error: k: Format of site key was invalid

I double-checked, and I did input my reCAPTCHA exactly as it appears on my account info on

For reference, here are the keys I was using (they have since been deleted, so they won't work anymore):

  • Public Key: 6Ld7UM8SAAAAAGrn74ADTPQLi8DfYikQH3_WmkgA
  • Private Key: 6Ld7UM8SAAAAAB-pIUr_5ki8PTuWWMLDf0eYo3DX
todofixthis's avatar
asked 2012-03-24 10:28:46 -0500, updated 2012-04-14 15:39:50 -0500
edit flag offensive 0 remove flag close merge delete



Got the same error. Be sure to restart your server after saving the new settings for reCaptcha.

nr's avatar nr (2012-09-12 05:58:35 -0500) edit
add a comment see more comments

3 Answers


I don't know exactly why, but adding to RECAPTCHA_USE_SSL = True solves this problem for me.

Possibly Google (current owner of the service) now requires encryption... We'll add this setting to the future release and the hosted sites.

Evgeny's avatar
answered 2012-04-15 16:53:39 -0500, updated 2012-04-15 16:53:54 -0500
edit flag offensive 0 remove flag delete link


Applied to the hosted sites.

Fitoria's avatar Fitoria (2012-04-16 14:27:32 -0500) edit

@todofixthis - does ReCaptcha work for you now?

Evgeny's avatar Evgeny (2012-04-17 15:50:39 -0500) edit

Generated new public/private keys and turned recaptcha on, but getting the same error as before when I go to create an account.

todofixthis's avatar todofixthis (2012-04-17 16:19:42 -0500) edit
add a comment see more comments

Have the exact same problem and took the liberty of taking a look at the HTML code of the page and the of the recaptcha module. I think I found the source of the error:

<script type="text/javascript"
   <iframe src="%(proto)s://"
       height="300" width="500" frameborder="0"></iframe><br>
   <textarea name="recaptcha_challenge_field" rows="3" cols="40">
<input type="hidden" name="recaptcha_response_field" value="manual_challenge">

As you can see, there are three variables options, proto and public_key supposed to be rendered into the string, but nothing is defined!

A quick and dirty solution is to replace %(public_key)s with your actual public key...

A. Pritschet's avatar
A. Pritschet
answered 2013-06-23 14:27:34 -0500, updated 2013-06-23 14:30:38 -0500
edit flag offensive 0 remove flag delete link


add a comment see more comments

One quick thing to check is if you switched from an AJAX display for your captcha to a PHP based display and left in:


Then comment out that function / function call, took me a while to figure out because it would only error out every 2/5 times depending on how fast the JavaScript loaded.

CoderCA's avatar
answered 2014-04-09 04:38:34 -0500
edit flag offensive 0 remove flag delete link


add a comment see more comments