cancel
Showing results for 
Search instead for 
Did you mean: 

Contact form on page - adding the script to page, however reCAPTCHA does not show

Contact form on page - adding the script to page, however reCAPTCHA does not show

Hi, 

 

Following the instructions provided in Magento's documentation , I added the following  script to display the default form on the page: 

 

{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}

 

However the reCAPTCHA  does not appear which is rather odd, as it is  configured properly and appears on the contact form page as well as on the registration page. 

 

When atttempting to submit the new form, I receive the following error which is just as  odd:

INCORRECT RECAPTCHA VALIDATION
 

 

The reCAPTCHA version is 2. 

 

The magento version is 2.3.4 

 

Please advise and thanks in advance,

 

A. 

 

 

 

 

 

5 REPLIES 5

Re: Contact form on page - adding the script to page, however reCAPTCHA does not show

@eran_ariel 

If you add the form on the improper page then Recaptcha will not work.

For more detail, you can check the code of the below extension

Magento_ReCaptchaContact
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: Contact form on page - adding the script to page, however reCAPTCHA does not show

Hi Sanjay and thank you. 

Are you referring that reCAPTCHA will work only on the page assigned to "contact" URL?

Re: Contact form on page - adding the script to page, however reCAPTCHA does not show

@eran_ariel 

Yes, only for action contact_index_post

You can check the below files

vendor\magento\module-re-captcha-contact\etc\frontend\events.xml

 

vendor\magento\module-re-captcha-contact\Observer

\ContactFormObserver.php

 

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: Contact form on page - adding the script to page, however reCAPTCHA does not show


@eran_ariel wrote:

Hi, 

 

Following the instructions provided in Magento's documentation , I added the following  script to display the default form on the page: 

 

{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}

 

However the reCAPTCHA  does not appear which is rather odd, as it is  configured properly and appears on the contact form page as well as on the registration page. 

 

When atttempting to submit the new form, I receive the following error which is just as  odd:

INCORRECT RECAPTCHA VALIDATION
 

 

The reCAPTCHA version is 2. 

 

The magento version is 2.3.4 

 

Please advise and thanks in advance,

 

A. 

 

 

 

 

 


This is best to add these type of content form on your website. It will surely boost your website ranking. I also use this on my web. You can simply download content form 7 to avoid reCaptcha issue.

Re: Contact form on page - adding the script to page, however reCAPTCHA does not show

OK, thank you for your reply.