Invalid Site Key Errors

Problem

While using a part of the Client Area that uses captchas for protection, you see the following error or are unable to log in:

ERROR for site owner: Invalid domain for site key

A Google reCAPTCHA Invalid Site Key error.

Cause

The Google reCAPTCHA or hCaptcha® site key is not valid (the domain name is not authorized).

This often occurs when you migrate WHMCS to a different domain name or subdomain. It may also occur if you have switched from one recaptcha type to another.

Solution

To resolve this issue, you can either correct the domain issue, disable captcha protection, or use the default captcha.

Add the Domain to Google reCAPTCHA

To do this:

  1. Log in to Google reCAPTCHA.
  2. Choose your site key from the menu.
  3. Click Settings.
  4. Under Domains, add the correct domain name.
  5. Optionally, remove the incorrect domain name.

Add the Domain to hCaptcha

To do this:

  1. Log in to your hCaptcha account.
  2. Add the correct domain name.
  3. Save your changes.

Disable Captchas

Disabling captchas will resolve the immediate issue and allow you to reconfigure captchas later. You may need to do this if, for example, you no longer have access to your Google reCAPTCHA or hCaptcha accounts.

To do this, run the following command to disable captchas in the WHMCS database:

UPDATE tblconfiguration SET value = '' WHERE setting = 'CaptchaSetting';

You should now be able to log in to the Admin Area and reconfigure captchas.

Switch to Default Captchas

WHMCS includes a default captcha option that does not require a Google reCAPTCHA or hCaptcha account. Switching to this option will display code verification captchas that do not require additional configuration.

For more information, see Enable Default Captchas.

Last modified: September 6, 2024