GET form schema
A public endpoint returns the rendered HTML and a structured field list for your own components.
Developer tools
Render and submit Core Forms from Astro, Next.js, or any non-WordPress site.
Bundled with Core Forms, the WordPress forms plugin with every premium feature in the box. No add-on tax.
Headless WordPress forms let a site that doesn't run WordPress show a Core Forms form and send each submission back to WordPress. You need the Headless API module, a site API key and the form's Headless switch, plus reCAPTCHA or Turnstile before launch. Standard fields work over JSON. Payments and file uploads need a page hosted on WordPress.
Any form can be shared over REST, so a site that doesn't run WordPress can show it and post answers as JSON. WordPress runs validation, spam checks, storage and actions. Payments and file uploads don't work through the JSON endpoint, so keep those forms on a page hosted by WordPress.
Turn on the Headless API module (it's off by default), save one API key for the site, then switch on each form. Use the drop-in embed, which puts the key in the page, or fetch the form and submit through your own server route to keep the key private.
Full reference: Headless forms docs
A public endpoint returns the rendered HTML and a structured field list for your own components.
Accepts text answers as JSON, then runs validation, spam checks, storage and actions. It doesn't take files or payments.
Add a <div data-cf-form="…"> and <script src=".../embed.js">. It suits single-page forms with standard fields.
List your front ends in Allowed origins, but don't use the list as access control or spam protection. Any website, script or server can reach the endpoints.
Paste the div and script snippet into a page, add is:inline so Astro leaves the script alone, and entries land in the form's Submissions tab.
Fetch the public form schema, render inputs from its fields list, and post JSON through a server route that adds the key and sets the form ID.
Load embed.js once, call window.CoreFormsEmbed.mount() when the host element exists, and listen for cf:success to update your UI.
List every front end in Allowed origins and keep emails, webhooks and CRM actions configured once in WordPress.
Core Forms > Modules > turn on Headless API. It's off by default, and the headless routes return 404 until it's on.
Core Forms > Settings > Headless / REST > Generate. Add your front ends to Allowed origins, then save.
Edit the form, open its Headless tab, turn on Headless mode and save. Note the form ID and slug.
Configure Turnstile or reCAPTCHA v3, then load the captcha script on the external site, which can't use the WordPress scripts.
Paste the embed, or install a server-route starter to keep the key private. Send a test entry and check Submissions.
Every setting, filter, and error message is documented in the Headless forms docs.
<div data-cf-form="contact" data-cf-key="YOUR_SITE_API_KEY"></div>
<script src="https://cms.example.com/wp-json/core-forms/v1/embed.js" defer></script> Each server starter needs the submit script and server settings. Astro, Next.js and Cloudflare also need the shared proxy. Save each file where its card says, replace the example values, and send a test entry before launch.
embed.html The drop-in embed in a complete page. No backend needed, but the API key is visible in the page source. core-forms-proxy.ts Required by Astro, Next.js and Cloudflare. Save in src/lib/ for Astro, lib/ for Next.js or src/ for Cloudflare. core-forms-client.js Required by every server-route starter. Save in public/. It posts to your route and never holds the key. core-forms-captcha.js Adds Turnstile or reCAPTCHA v3 tokens. Save in public/ and load it before the embed or submit script. server.env The 4 values every server route needs. Use as .env, as .env.local for Next.js or as your host's environment variables. contact.astro Save as src/pages/contact.astro. It fetches the form at build time and loads the submit script. submit.ts Save as src/pages/api/submit.ts with the shared proxy. It needs your host's Astro adapter. page.tsx Save as app/contact/page.tsx next to CoreForm.tsx. It refreshes the form every 5 minutes. CoreForm.tsx Save as app/contact/CoreForm.tsx. The page imports it to connect the submit script. route.ts Save as app/api/submit/route.ts with the shared proxy. It adds the key on the server. worker.ts Save as src/worker.ts with the shared proxy. It handles /api/submit and serves your static files. wrangler.jsonc Pairs with worker.ts. Add the key with wrangler secret put CORE_FORMS_API_KEY. submit.php Save as public/api/submit.php. It needs PHP 8 with cURL and reads the environment. contact.php Save as public/contact.php. It shows the form and posts to submit.php. server.cjs Save as server.cjs. It needs Node.js 18 or newer and Express. index.html Save as public/index.html and match the field names to your form.
The Core Forms docs live on gauravtiwari.org/docs, with every setting, filter, and troubleshooting step for this integration.
_cf_h plus the form ID, keep it empty: a filled honeypot is treated as a bot, nothing is saved, and the endpoint still returns a generic success message.[], such as topics[], are accepted and treated the same as topics. Headless / Astro / Next and every Core Forms-built integration on this site are included with your
license.
Use code BLACKFRIDAY for 40% off either plan. Ends December 2 (IST).