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
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:
- Log in to Google reCAPTCHA.
- Choose your site key from the menu.
- Click Settings.
- Under Domains, add the correct domain name.
- Optionally, remove the incorrect domain name.
Add the Domain to hCaptcha
To do this:
- Log in to your hCaptcha account.
- Add the correct domain name.
- 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.
Last modified: September 9, 2024