I have around 20 popup custom forms in my magento 2. I want to add Google recaptcha V3 for the all popup forms.

How can i add captcha v3 to all the forms. what is the best way to add for all the custom forms in magento 2.


2 Answers 2


You need to implement this code: Magento 2.4 Add Recaptcha in Custom From

And then you need to follow the below actions.

  1. Add your action event in the events.xml file.
  2. Update your layout file like demorecaptcha_index_index.xml
  3. Call Recaptcha using getchildHtml like form.phtml
  • HI @Msquare, thanks for your responce. So here for each form i need to create new observer right?
    – Mani
    Commented Jan 2, 2023 at 14:29
  • No @Mani, You need to add a new event and used the same observer.
    – Msquare
    Commented Jan 2, 2023 at 15:36

You need to check this link codes which how to add Google Recaptcha in Custom form explained.


In above link Very detailed explained.


Above link is third party module and that module provides add google recaptcha functionality custom form.

Let me know if any query.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.