How to set up Google captcha in Magento 2?main.CRITICAL: Plugin class doesn't existMagento 2: How to override newsletter Subscriber modelWhy Getting categories and names on product view page Magento 2 fails?Magento offline custom Payment method with drop down listHow to solve Front controller reached 100 router match iterations in magento2Magento 2.2.5 - How to add the google captcha in checkout page before place order buttonMagento 2.2.5 How to add google captcha to newsletter form without use any third party extensionMagento 2.3 Can't view module's front end page output?Magento 2 Google recaptcha js load failedGoogle Invisible Captcha “something went wrong” error upon form submission

What caused the tendency for conservatives to not support climate change reform?

Plot exactly N bounce of a ball

What is the best linguistic term for describing the kw > p / gw > b change, and its usual companion s > h

What is a subpixel in Super Mario Bros, and how does it relate to wall clipping?

Why would Lupin kill Pettigrew?

Can a Beholder use rays in melee range?

Is floating in space similar to falling under gravity?

Can the Help action be used to give advantage to a specific ally's attack (rather than just the next ally who attacks the target)?

Is this story about US tax office reasonable?

Can a non-EU citizen travel within schengen zone freely without passport?

Why did this prime-sequence puzzle not work?

Could I be denied entry into Ireland due to medical and police situations during a previous UK visit?

How to extract lower and upper bound in numeric format from a confidence interval string?

The qvolume of an integer

Is there any use case for the bottom type as a function parameter type?

File globbing pattern, !(*example), behaves differently in bash script than it does in bash shell

What does it mean when you think without speaking?

Tic-Tac-Toe for the terminal

Is this light switch installation safe and legal?

I think I may have violated academic integrity last year - what should I do?

How feasible is the Delta-Glider?

How could Catholicism have incorporated witchcraft into its dogma?

What problems does SciDraw still solve?

Is CD audio quality good enough for the final delivery of music?



How to set up Google captcha in Magento 2?


main.CRITICAL: Plugin class doesn't existMagento 2: How to override newsletter Subscriber modelWhy Getting categories and names on product view page Magento 2 fails?Magento offline custom Payment method with drop down listHow to solve Front controller reached 100 router match iterations in magento2Magento 2.2.5 - How to add the google captcha in checkout page before place order buttonMagento 2.2.5 How to add google captcha to newsletter form without use any third party extensionMagento 2.3 Can't view module's front end page output?Magento 2 Google recaptcha js load failedGoogle Invisible Captcha “something went wrong” error upon form submission






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















You need to do a captcha validation so that the data is not saved in the database if the captcha is not correct.
Here is the controller where the form is saved and validated.




RonisFeedbackControllerIndexPost.php




use MagentoFrameworkAppActionHttpPostActionInterface as HttpPostActionInterface;
use RonisFeedbackModelConfigInterface;
use RonisFeedbackModelMailInterface;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppRequestDataPersistorInterface;
use MagentoFrameworkControllerResultRedirect;
use MagentoFrameworkExceptionLocalizedException;
use PsrLogLoggerInterface;
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkDataObject;

class Post extends RonisFeedbackControllerIndex implements HttpPostActionInterface

protected $httpHeader;
/**
* @var DataPersistorInterface
*/
private $dataPersistor;

/**
* @var Context
*/
private $context;

/**
* @var MailInterface
*/
private $mail;

/**
* @var LoggerInterface
*/
private $logger;

/**
* @param MagentoFrameworkHTTPHeader $httpHeader,
* @param Context $context
* @param ConfigInterface $feedbackConfig
* @param MailInterface $mail
* @param DataPersistorInterface $dataPersistor
* @param LoggerInterface $logger
*/

public function __construct(
Context $context,
MagentoFrameworkHTTPHeader $httpHeader,
ConfigInterface $feedbackConfig,
MailInterface $mail,
DataPersistorInterface $dataPersistor,
LoggerInterface $logger = null
)
parent::__construct($context, $feedbackConfig);
$this->httpHeader = $httpHeader;
$this->context = $context;
$this->mail = $mail;
$this->dataPersistor = $dataPersistor;
$this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class);


/**
* Post user question
*
* @return Redirect
*/
public function execute()

if (!$this->getRequest()->isPost())
return $this->resultRedirectFactory->create()->setPath('*/*/');

try
$this->addDataBd($this->validatedParams());
$this->sendEmail($this->validatedParams());
$this->messageManager->addSuccessMessage(
__('Thanks for contacting us with your comments and questions. We'll respond to you very soon.')
);
$this->dataPersistor->clear('feedback');
catch (LocalizedException $e)
$this->messageManager->addErrorMessage($e->getMessage());
$this->dataPersistor->set('feedback', $this->getRequest()->getParams());
catch (Exception $e)
$this->logger->critical($e);
$this->messageManager->addErrorMessage(
__('An error occurred while processing your form. Please try again later.')
);
$this->dataPersistor->set('feedback', $this->getRequest()->getParams());

return $this->resultRedirectFactory->create()->setPath('feedback/index');


//6LcRJZcUAAAAAA0_SbrE_fHW1zbaJ3JnpMlwUwkt - site

//6LcRJZcUAAAAALfF-aLq9804zowngpLlcu_Qi1-P - secret
/**
* @return array
* @throws Exception
*/
private function validatedParams()

$request = $this->getRequest();
if (trim($request->getParam('feedback_name')) === '')
throw new LocalizedException(__('Enter the Name and try again.'));

if (trim($request->getParam('feedback_content')) === '')
throw new LocalizedException(__('Enter the comment and try again.'));

if (trim($request->getParam('feedback_subject')) === '')
throw new LocalizedException(__('Enter the subject and try again.'));

if (false === strpos($request->getParam('feedback_email'), '@'))
throw new LocalizedException(__('The email address is invalid. Verify the email address and try again.'));


return $request->getParams();

private function addDataBd()
$objctManager = MagentoFrameworkAppObjectManager::getInstance();

$feedback = $objctManager->create('RonisFeedbackModelFeedback');

$name = $this->getRequest()->getPost('feedback_name');
$email = $this->getRequest()->getPost('feedback_email');
$phone = $this->getRequest()->getPost('feedback_telephone');
$userAgent = $this->httpHeader->getHttpUserAgent();
$remote = $objctManager->get('MagentoFrameworkHTTPPhpEnvironmentRemoteAddress'); //remote ip
$subject = $this->getRequest()->getPost('feedback_subject');
$other_subject = $this->getRequest()->getPost('other_subject');
$message = $this->getRequest()->getPost('feedback_content');

$feedback->setData('feedback_name', $name);
$feedback->setData('feedback_email', $email);
$feedback->setData('feedback_telephone', $phone);
if($subject == 'other')
$feedback->setData('feedback_subject', $other_subject);

else
$feedback->setData('feedback_subject', $subject);

$feedback->setData('feedback_content', $message);
$feedback->setData('is_active', 0);
$feedback->setData('feedback_user_agent', $userAgent);
$feedback->setData('feedback_remote_ip', $remote->getRemoteAddress());
$feedback->save();


/**
* @param array $post Post data from feedback form
* @return void
*/
private function sendEmail($post)

$this->mail->send(
$post['feedback_email'],
['data' => new DataObject($post)]
);












share|improve this question




























    1















    You need to do a captcha validation so that the data is not saved in the database if the captcha is not correct.
    Here is the controller where the form is saved and validated.




    RonisFeedbackControllerIndexPost.php




    use MagentoFrameworkAppActionHttpPostActionInterface as HttpPostActionInterface;
    use RonisFeedbackModelConfigInterface;
    use RonisFeedbackModelMailInterface;
    use MagentoFrameworkAppActionContext;
    use MagentoFrameworkAppRequestDataPersistorInterface;
    use MagentoFrameworkControllerResultRedirect;
    use MagentoFrameworkExceptionLocalizedException;
    use PsrLogLoggerInterface;
    use MagentoFrameworkAppObjectManager;
    use MagentoFrameworkDataObject;

    class Post extends RonisFeedbackControllerIndex implements HttpPostActionInterface

    protected $httpHeader;
    /**
    * @var DataPersistorInterface
    */
    private $dataPersistor;

    /**
    * @var Context
    */
    private $context;

    /**
    * @var MailInterface
    */
    private $mail;

    /**
    * @var LoggerInterface
    */
    private $logger;

    /**
    * @param MagentoFrameworkHTTPHeader $httpHeader,
    * @param Context $context
    * @param ConfigInterface $feedbackConfig
    * @param MailInterface $mail
    * @param DataPersistorInterface $dataPersistor
    * @param LoggerInterface $logger
    */

    public function __construct(
    Context $context,
    MagentoFrameworkHTTPHeader $httpHeader,
    ConfigInterface $feedbackConfig,
    MailInterface $mail,
    DataPersistorInterface $dataPersistor,
    LoggerInterface $logger = null
    )
    parent::__construct($context, $feedbackConfig);
    $this->httpHeader = $httpHeader;
    $this->context = $context;
    $this->mail = $mail;
    $this->dataPersistor = $dataPersistor;
    $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class);


    /**
    * Post user question
    *
    * @return Redirect
    */
    public function execute()

    if (!$this->getRequest()->isPost())
    return $this->resultRedirectFactory->create()->setPath('*/*/');

    try
    $this->addDataBd($this->validatedParams());
    $this->sendEmail($this->validatedParams());
    $this->messageManager->addSuccessMessage(
    __('Thanks for contacting us with your comments and questions. We'll respond to you very soon.')
    );
    $this->dataPersistor->clear('feedback');
    catch (LocalizedException $e)
    $this->messageManager->addErrorMessage($e->getMessage());
    $this->dataPersistor->set('feedback', $this->getRequest()->getParams());
    catch (Exception $e)
    $this->logger->critical($e);
    $this->messageManager->addErrorMessage(
    __('An error occurred while processing your form. Please try again later.')
    );
    $this->dataPersistor->set('feedback', $this->getRequest()->getParams());

    return $this->resultRedirectFactory->create()->setPath('feedback/index');


    //6LcRJZcUAAAAAA0_SbrE_fHW1zbaJ3JnpMlwUwkt - site

    //6LcRJZcUAAAAALfF-aLq9804zowngpLlcu_Qi1-P - secret
    /**
    * @return array
    * @throws Exception
    */
    private function validatedParams()

    $request = $this->getRequest();
    if (trim($request->getParam('feedback_name')) === '')
    throw new LocalizedException(__('Enter the Name and try again.'));

    if (trim($request->getParam('feedback_content')) === '')
    throw new LocalizedException(__('Enter the comment and try again.'));

    if (trim($request->getParam('feedback_subject')) === '')
    throw new LocalizedException(__('Enter the subject and try again.'));

    if (false === strpos($request->getParam('feedback_email'), '@'))
    throw new LocalizedException(__('The email address is invalid. Verify the email address and try again.'));


    return $request->getParams();

    private function addDataBd()
    $objctManager = MagentoFrameworkAppObjectManager::getInstance();

    $feedback = $objctManager->create('RonisFeedbackModelFeedback');

    $name = $this->getRequest()->getPost('feedback_name');
    $email = $this->getRequest()->getPost('feedback_email');
    $phone = $this->getRequest()->getPost('feedback_telephone');
    $userAgent = $this->httpHeader->getHttpUserAgent();
    $remote = $objctManager->get('MagentoFrameworkHTTPPhpEnvironmentRemoteAddress'); //remote ip
    $subject = $this->getRequest()->getPost('feedback_subject');
    $other_subject = $this->getRequest()->getPost('other_subject');
    $message = $this->getRequest()->getPost('feedback_content');

    $feedback->setData('feedback_name', $name);
    $feedback->setData('feedback_email', $email);
    $feedback->setData('feedback_telephone', $phone);
    if($subject == 'other')
    $feedback->setData('feedback_subject', $other_subject);

    else
    $feedback->setData('feedback_subject', $subject);

    $feedback->setData('feedback_content', $message);
    $feedback->setData('is_active', 0);
    $feedback->setData('feedback_user_agent', $userAgent);
    $feedback->setData('feedback_remote_ip', $remote->getRemoteAddress());
    $feedback->save();


    /**
    * @param array $post Post data from feedback form
    * @return void
    */
    private function sendEmail($post)

    $this->mail->send(
    $post['feedback_email'],
    ['data' => new DataObject($post)]
    );












    share|improve this question
























      1












      1








      1








      You need to do a captcha validation so that the data is not saved in the database if the captcha is not correct.
      Here is the controller where the form is saved and validated.




      RonisFeedbackControllerIndexPost.php




      use MagentoFrameworkAppActionHttpPostActionInterface as HttpPostActionInterface;
      use RonisFeedbackModelConfigInterface;
      use RonisFeedbackModelMailInterface;
      use MagentoFrameworkAppActionContext;
      use MagentoFrameworkAppRequestDataPersistorInterface;
      use MagentoFrameworkControllerResultRedirect;
      use MagentoFrameworkExceptionLocalizedException;
      use PsrLogLoggerInterface;
      use MagentoFrameworkAppObjectManager;
      use MagentoFrameworkDataObject;

      class Post extends RonisFeedbackControllerIndex implements HttpPostActionInterface

      protected $httpHeader;
      /**
      * @var DataPersistorInterface
      */
      private $dataPersistor;

      /**
      * @var Context
      */
      private $context;

      /**
      * @var MailInterface
      */
      private $mail;

      /**
      * @var LoggerInterface
      */
      private $logger;

      /**
      * @param MagentoFrameworkHTTPHeader $httpHeader,
      * @param Context $context
      * @param ConfigInterface $feedbackConfig
      * @param MailInterface $mail
      * @param DataPersistorInterface $dataPersistor
      * @param LoggerInterface $logger
      */

      public function __construct(
      Context $context,
      MagentoFrameworkHTTPHeader $httpHeader,
      ConfigInterface $feedbackConfig,
      MailInterface $mail,
      DataPersistorInterface $dataPersistor,
      LoggerInterface $logger = null
      )
      parent::__construct($context, $feedbackConfig);
      $this->httpHeader = $httpHeader;
      $this->context = $context;
      $this->mail = $mail;
      $this->dataPersistor = $dataPersistor;
      $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class);


      /**
      * Post user question
      *
      * @return Redirect
      */
      public function execute()

      if (!$this->getRequest()->isPost())
      return $this->resultRedirectFactory->create()->setPath('*/*/');

      try
      $this->addDataBd($this->validatedParams());
      $this->sendEmail($this->validatedParams());
      $this->messageManager->addSuccessMessage(
      __('Thanks for contacting us with your comments and questions. We'll respond to you very soon.')
      );
      $this->dataPersistor->clear('feedback');
      catch (LocalizedException $e)
      $this->messageManager->addErrorMessage($e->getMessage());
      $this->dataPersistor->set('feedback', $this->getRequest()->getParams());
      catch (Exception $e)
      $this->logger->critical($e);
      $this->messageManager->addErrorMessage(
      __('An error occurred while processing your form. Please try again later.')
      );
      $this->dataPersistor->set('feedback', $this->getRequest()->getParams());

      return $this->resultRedirectFactory->create()->setPath('feedback/index');


      //6LcRJZcUAAAAAA0_SbrE_fHW1zbaJ3JnpMlwUwkt - site

      //6LcRJZcUAAAAALfF-aLq9804zowngpLlcu_Qi1-P - secret
      /**
      * @return array
      * @throws Exception
      */
      private function validatedParams()

      $request = $this->getRequest();
      if (trim($request->getParam('feedback_name')) === '')
      throw new LocalizedException(__('Enter the Name and try again.'));

      if (trim($request->getParam('feedback_content')) === '')
      throw new LocalizedException(__('Enter the comment and try again.'));

      if (trim($request->getParam('feedback_subject')) === '')
      throw new LocalizedException(__('Enter the subject and try again.'));

      if (false === strpos($request->getParam('feedback_email'), '@'))
      throw new LocalizedException(__('The email address is invalid. Verify the email address and try again.'));


      return $request->getParams();

      private function addDataBd()
      $objctManager = MagentoFrameworkAppObjectManager::getInstance();

      $feedback = $objctManager->create('RonisFeedbackModelFeedback');

      $name = $this->getRequest()->getPost('feedback_name');
      $email = $this->getRequest()->getPost('feedback_email');
      $phone = $this->getRequest()->getPost('feedback_telephone');
      $userAgent = $this->httpHeader->getHttpUserAgent();
      $remote = $objctManager->get('MagentoFrameworkHTTPPhpEnvironmentRemoteAddress'); //remote ip
      $subject = $this->getRequest()->getPost('feedback_subject');
      $other_subject = $this->getRequest()->getPost('other_subject');
      $message = $this->getRequest()->getPost('feedback_content');

      $feedback->setData('feedback_name', $name);
      $feedback->setData('feedback_email', $email);
      $feedback->setData('feedback_telephone', $phone);
      if($subject == 'other')
      $feedback->setData('feedback_subject', $other_subject);

      else
      $feedback->setData('feedback_subject', $subject);

      $feedback->setData('feedback_content', $message);
      $feedback->setData('is_active', 0);
      $feedback->setData('feedback_user_agent', $userAgent);
      $feedback->setData('feedback_remote_ip', $remote->getRemoteAddress());
      $feedback->save();


      /**
      * @param array $post Post data from feedback form
      * @return void
      */
      private function sendEmail($post)

      $this->mail->send(
      $post['feedback_email'],
      ['data' => new DataObject($post)]
      );












      share|improve this question














      You need to do a captcha validation so that the data is not saved in the database if the captcha is not correct.
      Here is the controller where the form is saved and validated.




      RonisFeedbackControllerIndexPost.php




      use MagentoFrameworkAppActionHttpPostActionInterface as HttpPostActionInterface;
      use RonisFeedbackModelConfigInterface;
      use RonisFeedbackModelMailInterface;
      use MagentoFrameworkAppActionContext;
      use MagentoFrameworkAppRequestDataPersistorInterface;
      use MagentoFrameworkControllerResultRedirect;
      use MagentoFrameworkExceptionLocalizedException;
      use PsrLogLoggerInterface;
      use MagentoFrameworkAppObjectManager;
      use MagentoFrameworkDataObject;

      class Post extends RonisFeedbackControllerIndex implements HttpPostActionInterface

      protected $httpHeader;
      /**
      * @var DataPersistorInterface
      */
      private $dataPersistor;

      /**
      * @var Context
      */
      private $context;

      /**
      * @var MailInterface
      */
      private $mail;

      /**
      * @var LoggerInterface
      */
      private $logger;

      /**
      * @param MagentoFrameworkHTTPHeader $httpHeader,
      * @param Context $context
      * @param ConfigInterface $feedbackConfig
      * @param MailInterface $mail
      * @param DataPersistorInterface $dataPersistor
      * @param LoggerInterface $logger
      */

      public function __construct(
      Context $context,
      MagentoFrameworkHTTPHeader $httpHeader,
      ConfigInterface $feedbackConfig,
      MailInterface $mail,
      DataPersistorInterface $dataPersistor,
      LoggerInterface $logger = null
      )
      parent::__construct($context, $feedbackConfig);
      $this->httpHeader = $httpHeader;
      $this->context = $context;
      $this->mail = $mail;
      $this->dataPersistor = $dataPersistor;
      $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class);


      /**
      * Post user question
      *
      * @return Redirect
      */
      public function execute()

      if (!$this->getRequest()->isPost())
      return $this->resultRedirectFactory->create()->setPath('*/*/');

      try
      $this->addDataBd($this->validatedParams());
      $this->sendEmail($this->validatedParams());
      $this->messageManager->addSuccessMessage(
      __('Thanks for contacting us with your comments and questions. We'll respond to you very soon.')
      );
      $this->dataPersistor->clear('feedback');
      catch (LocalizedException $e)
      $this->messageManager->addErrorMessage($e->getMessage());
      $this->dataPersistor->set('feedback', $this->getRequest()->getParams());
      catch (Exception $e)
      $this->logger->critical($e);
      $this->messageManager->addErrorMessage(
      __('An error occurred while processing your form. Please try again later.')
      );
      $this->dataPersistor->set('feedback', $this->getRequest()->getParams());

      return $this->resultRedirectFactory->create()->setPath('feedback/index');


      //6LcRJZcUAAAAAA0_SbrE_fHW1zbaJ3JnpMlwUwkt - site

      //6LcRJZcUAAAAALfF-aLq9804zowngpLlcu_Qi1-P - secret
      /**
      * @return array
      * @throws Exception
      */
      private function validatedParams()

      $request = $this->getRequest();
      if (trim($request->getParam('feedback_name')) === '')
      throw new LocalizedException(__('Enter the Name and try again.'));

      if (trim($request->getParam('feedback_content')) === '')
      throw new LocalizedException(__('Enter the comment and try again.'));

      if (trim($request->getParam('feedback_subject')) === '')
      throw new LocalizedException(__('Enter the subject and try again.'));

      if (false === strpos($request->getParam('feedback_email'), '@'))
      throw new LocalizedException(__('The email address is invalid. Verify the email address and try again.'));


      return $request->getParams();

      private function addDataBd()
      $objctManager = MagentoFrameworkAppObjectManager::getInstance();

      $feedback = $objctManager->create('RonisFeedbackModelFeedback');

      $name = $this->getRequest()->getPost('feedback_name');
      $email = $this->getRequest()->getPost('feedback_email');
      $phone = $this->getRequest()->getPost('feedback_telephone');
      $userAgent = $this->httpHeader->getHttpUserAgent();
      $remote = $objctManager->get('MagentoFrameworkHTTPPhpEnvironmentRemoteAddress'); //remote ip
      $subject = $this->getRequest()->getPost('feedback_subject');
      $other_subject = $this->getRequest()->getPost('other_subject');
      $message = $this->getRequest()->getPost('feedback_content');

      $feedback->setData('feedback_name', $name);
      $feedback->setData('feedback_email', $email);
      $feedback->setData('feedback_telephone', $phone);
      if($subject == 'other')
      $feedback->setData('feedback_subject', $other_subject);

      else
      $feedback->setData('feedback_subject', $subject);

      $feedback->setData('feedback_content', $message);
      $feedback->setData('is_active', 0);
      $feedback->setData('feedback_user_agent', $userAgent);
      $feedback->setData('feedback_remote_ip', $remote->getRemoteAddress());
      $feedback->save();


      /**
      * @param array $post Post data from feedback form
      * @return void
      */
      private function sendEmail($post)

      $this->mail->send(
      $post['feedback_email'],
      ['data' => new DataObject($post)]
      );









      magento2 recaptcha






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 20 at 10:03









      Рома ЛытарьРома Лытарь

      1859




      1859




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Magento 2 already has extension for google captcha. You can check the below post from magento.



          https://docs.magento.com/m2/ce/user_guide/magento/extension-install-google-recaptcha.html



          You can extend that module in your layout file to add the captcha in your form which will solve your problem.






          share|improve this answer


















          • 1





            Magento provide google default captcha in Higher than Magento version 2.3.x

            – Chirag Patel
            Mar 20 at 10:26











          • Not older version of 2.3.x

            – Chirag Patel
            Mar 20 at 10:26












          • So there you can choose only basic forms, and how can I do for my custom form that I use in the module

            – Рома Лытарь
            Mar 20 at 10:31











          • you can extend the module functionality to your module and show the necessary template in your layout file. And you have check @ChiragPatel answer also. It supports only m2.3.x version.

            – Thamo
            Mar 20 at 11:20












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266651%2fhow-to-set-up-google-captcha-in-magento-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Magento 2 already has extension for google captcha. You can check the below post from magento.



          https://docs.magento.com/m2/ce/user_guide/magento/extension-install-google-recaptcha.html



          You can extend that module in your layout file to add the captcha in your form which will solve your problem.






          share|improve this answer


















          • 1





            Magento provide google default captcha in Higher than Magento version 2.3.x

            – Chirag Patel
            Mar 20 at 10:26











          • Not older version of 2.3.x

            – Chirag Patel
            Mar 20 at 10:26












          • So there you can choose only basic forms, and how can I do for my custom form that I use in the module

            – Рома Лытарь
            Mar 20 at 10:31











          • you can extend the module functionality to your module and show the necessary template in your layout file. And you have check @ChiragPatel answer also. It supports only m2.3.x version.

            – Thamo
            Mar 20 at 11:20
















          0














          Magento 2 already has extension for google captcha. You can check the below post from magento.



          https://docs.magento.com/m2/ce/user_guide/magento/extension-install-google-recaptcha.html



          You can extend that module in your layout file to add the captcha in your form which will solve your problem.






          share|improve this answer


















          • 1





            Magento provide google default captcha in Higher than Magento version 2.3.x

            – Chirag Patel
            Mar 20 at 10:26











          • Not older version of 2.3.x

            – Chirag Patel
            Mar 20 at 10:26












          • So there you can choose only basic forms, and how can I do for my custom form that I use in the module

            – Рома Лытарь
            Mar 20 at 10:31











          • you can extend the module functionality to your module and show the necessary template in your layout file. And you have check @ChiragPatel answer also. It supports only m2.3.x version.

            – Thamo
            Mar 20 at 11:20














          0












          0








          0







          Magento 2 already has extension for google captcha. You can check the below post from magento.



          https://docs.magento.com/m2/ce/user_guide/magento/extension-install-google-recaptcha.html



          You can extend that module in your layout file to add the captcha in your form which will solve your problem.






          share|improve this answer













          Magento 2 already has extension for google captcha. You can check the below post from magento.



          https://docs.magento.com/m2/ce/user_guide/magento/extension-install-google-recaptcha.html



          You can extend that module in your layout file to add the captcha in your form which will solve your problem.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 20 at 10:24









          ThamoThamo

          1415




          1415







          • 1





            Magento provide google default captcha in Higher than Magento version 2.3.x

            – Chirag Patel
            Mar 20 at 10:26











          • Not older version of 2.3.x

            – Chirag Patel
            Mar 20 at 10:26












          • So there you can choose only basic forms, and how can I do for my custom form that I use in the module

            – Рома Лытарь
            Mar 20 at 10:31











          • you can extend the module functionality to your module and show the necessary template in your layout file. And you have check @ChiragPatel answer also. It supports only m2.3.x version.

            – Thamo
            Mar 20 at 11:20













          • 1





            Magento provide google default captcha in Higher than Magento version 2.3.x

            – Chirag Patel
            Mar 20 at 10:26











          • Not older version of 2.3.x

            – Chirag Patel
            Mar 20 at 10:26












          • So there you can choose only basic forms, and how can I do for my custom form that I use in the module

            – Рома Лытарь
            Mar 20 at 10:31











          • you can extend the module functionality to your module and show the necessary template in your layout file. And you have check @ChiragPatel answer also. It supports only m2.3.x version.

            – Thamo
            Mar 20 at 11:20








          1




          1





          Magento provide google default captcha in Higher than Magento version 2.3.x

          – Chirag Patel
          Mar 20 at 10:26





          Magento provide google default captcha in Higher than Magento version 2.3.x

          – Chirag Patel
          Mar 20 at 10:26













          Not older version of 2.3.x

          – Chirag Patel
          Mar 20 at 10:26






          Not older version of 2.3.x

          – Chirag Patel
          Mar 20 at 10:26














          So there you can choose only basic forms, and how can I do for my custom form that I use in the module

          – Рома Лытарь
          Mar 20 at 10:31





          So there you can choose only basic forms, and how can I do for my custom form that I use in the module

          – Рома Лытарь
          Mar 20 at 10:31













          you can extend the module functionality to your module and show the necessary template in your layout file. And you have check @ChiragPatel answer also. It supports only m2.3.x version.

          – Thamo
          Mar 20 at 11:20






          you can extend the module functionality to your module and show the necessary template in your layout file. And you have check @ChiragPatel answer also. It supports only m2.3.x version.

          – Thamo
          Mar 20 at 11:20


















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266651%2fhow-to-set-up-google-captcha-in-magento-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?