Recaptcha: Error for site owner

  • Post author:
  • Post last modified:May 26, 2023
  • Reading time:2 mins read

1.0 Error


The login form for a Drupal based site had the username, password and recaptcha fields. However, instead of showing the image and input box, recaptcha displayed ERROR for site owner, Invalid domain for site key. Thus, it became impossible to login to the site. This effectively locked access to the administration menu of the site.

2.0 Solution

  1. Login to the web server from the command line using SSH.
  2. Go to the website root directory, say /www/website. Go to the modules directory, /www/website/sites/all/modules. Remove the recaptcha sub-directory, by giving the command, rm -fr recaptcha.
  3. Stop the webserver. Clear the cached files and restart the webserver. Also clear the browser cached files.
  4. Reopen the login page in browser. Now, the captcha should not be present in the form and it should be possible to login giving the username and password.
  5. Download the latest version of recaptcha from the recaptcha page. Install the recaptcha module.
  6. Generate an API key pair from here.
  7. Configure the recaptcha module by entering the site key and secret key.

Karunesh Johri

Software developer, working with C and Linux.