Ask Your Question

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

asked 2012-03-24 10:28:46 -0500

todofixthis's avatar

updated 2012-04-14 15:39:50 -0500

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
edit retag flag offensive 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

3 Answers

Sort by ยป oldest newest most voted

answered 2012-04-15 16:53:39 -0500

Evgeny's avatar

updated 2012-04-15 16:53:54 -0500

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.

edit flag offensive delete link more


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

answered 2014-04-09 04:38:34 -0500

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.

edit flag offensive delete link more

answered 2013-06-23 14:27:34 -0500

A. Pritschet's avatar

updated 2013-06-23 14:30:38 -0500

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...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-03-24 10:28:46 -0500

Seen: 30,553 times

Last updated: Apr 09 '14