A good captcha solution is essential for anyone using Mautic forms. The current plugins had outdated code and limited options. That’s why we’ve been working on a new captcha plugin. The first version is now on Github.
Good to know:
The plugin is free.
Support for Google reCAPTCHA, hCaptcha and Cloudflare Turnstile!
This plugin only works with Mautic 6. So it’s ready for the future, but you’ll have to wait a bit longer to use it in production.
Thank you to everyone who worked on older captcha plugins. And thanks to my colleague Roel who did almost all the work.
Read more about the plugin on the Github page:
I would love it if you leave a message in this topic if you use the plugin.
Thank you for making the Mautic community better with your fantastic contribution by sharing this plugin totally free. It will certainly help a lot of people - definitely a must-have!
Since many Mautic users are often hesitant to upgrade and continue using older versions, having a compatible version for Mautic 5 would be extremely valuable. If you’re able to adapt it, the whole community would benefit - but of course, that’s entirely up to you!
After consulting with my colleague we have decided not to provide support for Mautic 5. But if anyone wants to contribute we will follow up pull requests.
thanks for the plugin, I followed all the instruccions, but when use it, it appear this message in Mautic logs.
[2025-06-08T01:32:40.731744+00:00] mautic.CRITICAL: Uncaught PHP Exception Doctrine\ORM\ORMInvalidArgumentException: “A new entity was found through the relationship ‘Mautic\FormBundle\Entity\Submission#lead’ that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #0. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={“persist”}).” at /var/www/html/mautic.opin-x.com/public_html/vendor/doctrine/orm/src/ORMInvalidArgumentException.php line 103 {“exception”:“[object] (Doctrine\ORM\ORMInvalidArgumentException(code: 0): A new entity was found through the relationship ‘Mautic\FormBundle\Entity\Submission#lead’ that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #0. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={"persist"}). at /var/www/html/mautic.opin-x.com/public_html/vendor/doctrine/orm/src/ORMInvalidArgumentException.php:103)”} {“hostname”:“ip-172-31-28-116”,“pid”:1897}
Y solo ocurre cuando el plugin esta activo y agrego alguno de los captchas al formulario
We are experiencing the same error. We’ve tried hCaptcha and Turnstile options. Oddly the Google ReCaptcha plugin doesn’t show up in the Plugins section.
We’re using Mautic 6.0.2
[2025-06-11T12:42:32.373549+00:00] mautic.CRITICAL: Uncaught PHP Exception Doctrine\ORM\ORMInvalidArgumentException: “A new entity was found through the relationship ‘Mautic\FormBundle\Entity\Submission#lead’ that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #0. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={“persist”}).” at /path/to/mautic/vendor/doctrine/orm/src/ORMInvalidArgumentException.php line 103 {“exception”:“[object] (Doctrine\ORM\ORMInvalidArgumentException(code: 0): A new entity was found through the relationship ‘Mautic\FormBundle\Entity\Submission#lead’ that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #0. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={"persist"}). at /path/to/mautic/vendor/doctrine/orm/src/ORMInvalidArgumentException.php:103)”} {“hostname”:“mauticserver”,“pid”:2532531}
It looks like you used a different reCAPTCHA plugin in the past, and there are still leftover traces of it in the database. That old plugin needs to be fully removed first.
My advice would be to delete everything from the plugins table that contains “captcha” in the name, and then refresh the plugins. We had a similar issue with our demo installation of Mautic 5, and this approach worked for us.
You can run the following SQL query to clean it up:
REMOVE FROM `plugins` WHERE `id` IN (SELECT `id` FROM `plugins` WHERE `name` LIKE '%captcha%');