Hi everyone,
We’ve been successfully using Gravity Forms with reCAPTCHA in a headless WordPress setup (Next.js frontend + WordPress backend). Everything has worked fine until recently — now we’re running into an issue specifically when reCAPTCHA is enabled.
Setup:
- Frontend: Next.js (headless)
- Backend: WordPress with Gravity Forms
- Form: Embedded/styled on the frontend via REST API
- reCAPTCHA: Configured in Gravity Forms (v2) - v3 not supported apparently.
Problem:
When reCAPTCHA is enabled and the form is submitted from the frontend, the user is unexpectedly redirected to an unstyled form page on the WordPress backend, where the reCAPTCHA executes and the form completes submission. The form works without reCAPTCHA, so we believe the issue is specifically related to how reCAPTCHA is being handled in the headless environment.
This results in a broken user experience — users are bounced to a raw WP form page, which defeats the point of having a styled headless frontend.
What we’ve tried:
- Disabling reCAPTCHA = form works as expected (no redirect)
- Re-enabling reCAPTCHA = redirect issue returns
- Confirmed reCAPTCHA keys are still valid and checked supported domains
- No recent changes to REST/GraphQL structure
- Gravity Forms, WP, and plugins are all up-to-date
- Exact same issue occurs when testing Cloudflare Turnstile
Questions:
- Has anyone encountered this issue before?
- Is there a known fix for using reCAPTCHA in headless Gravity Forms implementations?
- Would moving to GraphQL help handle reCAPTCHA more cleanly in a headless setup?
- Is there a way to prevent this fallback redirect and keep the user on the styled frontend?
Any advice, fixes, or workarounds would be hugely appreciated.