Page tree
Skip to end of metadata
Go to start of metadata
Magnolia Compatibility



Google ReCaptcha2 API module for Magnolia cms.

In this module we provide classes, annotations and form procerssors for easy and fast usage of Google ReCaptcha2 API.


To use this module, include it in your module dependencies. In freemarker templates you can add recaptcha field by including [#include "/magnolia-recaptcha2/templates/macros/recaptcha2.ftl"] which contains 2 macros:

  • reCaptchaField - render recaptcha with checkbox. Accept one parameter "callback" that can be used with API callback function name.
  • reCaptchaInvisible - render invisible recaptcha. Accept one parameter "callback" that can be used with API callback function name.


Jar files can be found on Magnolia Nexus. To add in project use module dependencies:





Validation annotation @ReCaptcha usage

You can use: nl.tricode.magnolia.recaptcha2.validation.ReCaptcha annotation to validate recaptcha in rest calls.

Java class usage

ReCaptcha2 class provides static methods for easy recaptcha response check with api.

Form processors usage

To use it in form, we provide nl.tricode.magnolia.recaptcha2.form.processors.ReCaptcha2FormProcessor form processorwhich validates recaptcha for submitted form.

Templating functions

Templating functions provides recaptcha site keys are registered under rec2fn and can be used to provide site key to your freemarkers.


After instaling module you need to configure API Site and API Secret key. This keys will be provided to you by Google ReCaptcha2 API after registering your site. After you get this keys, place them in Magnolia CMS -> /configuration/modules/magnolia-recaptcha2/config

  • reCaptchaSecret
  • reCaptchaSiteKey

Version History


  • First release on Magnolia Forge




Copyright (c) 2017 Tricode and contributors. Released under a GNUv3 license.


  1. Is this project still active - I noticed a 2018 commit in the github repository.

    Does it support newer versions of Magnolia? Has it been tested on newer versions?

    1. Christopher Zimmermann Tricode does not exist anymore. So maybe now this module is abandoned?

      Couple things to note about it:

      • Google is banned in China. So it certainty won't work there.
      • Some people have been reporting a bad user experience with it do to layering. Perhaps some z-index issue.

      As a workaround I would suggest trying our Form module as it provides a Honeypot field. See for more info.