function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bhargav vaishnav 2Bhargav vaishnav 2 

ERROR for site owner: Invalid site key

Hello, I try integration Google reCaptcha with visulforce page but I got an error like ERROR for site owner: Invalid site key so how to short out it, 
Here I attached my code as well

Thanks in advance to help me,


<apex:page showheader="false" controller="reCAPTCHA2_Controller"> 
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" media="screen"/> 
    <div class="jumborton"> 
        <apex:pageBlock > 
            <apex:pageMessages /> 
            <apex:form > 
                 <apex:pageBlockSection columns="1" collapsible="true" title="Create Contact useing reCaptcha"> 
                    <apex:pageBlockSectionItem > 
                        <apex:outputLabel for="inputName" value="First Name"/> 
                            <apex:inputText value="{!myfName}" id="inputName"/> 
                            </apex:pageBlockSectionItem> 
                            <apex:pageBlockSectionItem >
                                <apex:outputLabel for="inputName" value="Last Name"/>
                                    <apex:inputText value="{!mylName}" id="inputName"/> 
                                    </apex:pageBlockSectionItem> 
                                    <apex:pageBlockSectionItem >
                                        <apex:outputLabel for="inputEmail" value="Email"/>
                                            <apex:inputText value="{!myEmail}" id="inputEmail"/> 
                                            </apex:pageBlockSectionItem> 
                                            <div class="g-recaptcha" data-sitekey="6LcgmLgUAAAAAACGKfUu-S2X4B17OZlXR12u9k9A"></div>
                                          <script src="https://www.google.com/recaptcha/api.js"></script>
                                                 <br/>                     
                                                 <apex:commandButton value="Create Contact" action="{!doVerify}"/> 
                                                </apex:pageBlockSection> 
                                                </apex:form>
                                                </apex:pageBlock> 
                                                </div>
                                                </apex:page>
Best Answer chosen by Bhargav vaishnav 2
Khan AnasKhan Anas (Salesforce Developers) 
Hi Bhargav,

Greetings to you!

You need to ensure your site is added in the domains section of the google reCAPTCHA page where you generated the API key. 

Please refer to the below links which might help you further with the above issue.

https://stackoverflow.com/questions/48600034/recaptchaerror-for-site-owner-invalid-site-key

https://stackoverflow.com/questions/30735694/recaptcha-error-invalid-domain-for-site-key

https://stackoverflow.com/questions/44631918/error-for-site-owner-invalid-site-key

https://wordpress.org/support/topic/recaptcha-error-error-for-site-owner-invalid-site-key/

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi Bhargav,

Greetings to you!

You need to ensure your site is added in the domains section of the google reCAPTCHA page where you generated the API key. 

Please refer to the below links which might help you further with the above issue.

https://stackoverflow.com/questions/48600034/recaptchaerror-for-site-owner-invalid-site-key

https://stackoverflow.com/questions/30735694/recaptcha-error-invalid-domain-for-site-key

https://stackoverflow.com/questions/44631918/error-for-site-owner-invalid-site-key

https://wordpress.org/support/topic/recaptcha-error-error-for-site-owner-invalid-site-key/

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer
Bhargav vaishnav 2Bhargav vaishnav 2
Thanks, Khan Anas  your Those links were useful for me In a stackoverflow go though  one by one solution will definitely get an answer 


Thanks 
-Bhargav