Skip to content
Wrenform

Docs / Contact form guides

Add a contact form to a Cloudflare Pages site

A contact form on Cloudflare Pages that emails you, with no Function and no captcha.

Last updated 2026-11-21View as Markdown
Add a working contact form to this site, which is deployed on Cloudflare Pages. Create the form by sending POST https://wrenform.com/api/v1/quick-forms with JSON {"email": "YOUR_EMAIL", "framework": "html"} (if you can't make HTTP requests, give me the curl command to run). Put the returned snippet on a contact page, matching the site's style and its framework's syntax: a label for each field, type="email" on the email field, and keep the _honey field exactly as returned. Add a thank-you page and a hidden _redirect field whose value is that page's full https:// address on the production site (the custom domain if there is one, otherwise https://PROJECT.pages.dev). Don't write a Pages Function or Worker, and add no dependencies, API keys or server code. Then tell me to check my inbox for the Wrenform email and click Confirm, because messages are held until I do.

Replace YOUR_EMAIL with the address that should get the messages, and paste. This creates a form without an account: no sign-up, no mail provider, free for 250 submissions a month. Nothing is forwarded until you click Confirm in the email we send, and unconfirmed forms are deleted after 7 days. Prefer the dashboard? Create a form and use the snippet below.

The form posts from the visitor's browser straight to Wrenform, so the site needs no Pages Function, no Worker and no mail provider. It is plain HTML in whatever your build outputs: hand-written files, or a framework such as Astro, Hugo or Next.js exported as static pages.

Steps

  1. Paste the prompt into your coding tool, or paste the HTML below into your contact page.
  2. Add a thank-you page and the _redirect field (below).
  3. Click Confirm in the email from Wrenform.
  4. Push or upload as usual. Cloudflare Pages builds and deploys the site.

Lock the form to your site. A form created this way accepts posts from any site. Once you've confirmed, sign in with the same address and add your site's origins under Allowed origins in the form's settings (see below).

Or paste the code

<form action="https://wrenform.com/f/YOUR_FORM_ID" method="POST">
  <input type="text" name="name" required>
  <input type="email" name="email" required>
  <textarea name="message" required></textarea>
  <input type="text" name="_honey" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send</button>
</form>
<!-- Optional: a timing check against bots, and data-ajax to submit in place -->
<script src="https://wrenform.com/js/v1/form.js" defer></script>

Replace YOUR_FORM_ID with the ID from your form's Setup page. The script tag is optional: it adds the timing check. In a framework, keep the form as HTML: the action, method="POST" and the field names are all that matter.

Your thank-you page

Add this inside the form, with your own address:

<input type="hidden" name="_redirect" value="https://example.com/thanks">

The value must be a full https:// address: a relative /thanks is ignored, and visitors see our thank-you page instead. We follow _redirect only to a safe address: while Allowed origins is empty, it must be on the same origin as the page that sent the form; once you add origins, it must be on one of them. Signed in, you can set Redirect to in the form's settings instead. See redirects.

Custom domain or pages.dev

An origin is https:// plus the host, never a path.

Where the form is Origin to add
Production on pages.dev https://PROJECT.pages.dev
A custom domain https://example.com, and https://www.example.com if you serve both
Preview and branch deployments https://*.PROJECT.pages.dev

If the site is reachable on both its custom domain and PROJECT.pages.dev, add both, or visitors on the other one get origin_not_allowed. The wildcard matches every preview subdomain but not https://PROJECT.pages.dev itself, so keep that entry too. While Allowed origins is empty, a _redirect to production is ignored from a preview address, which then shows our thank-you page.

Spam and email

  • The hidden _honey field catches most bots. Keep it in the form, hidden, with autocomplete="off".
  • A timing check marks submissions sent less than 3 seconds after the form loaded as spam, when the form sends the timing field. The optional script in the HTML snippet adds it; see the timing field. No captcha is needed.
  • Messages sent before you confirm are held. A form without an account emails them when you click Confirm. On a form you created signed in, confirming a recipient emails the 20 most recent submissions from the last 7 days.
  • Submissions are stored in the EU.

Test it

Open the deployed contact page, send the form, and you should land on your thank-you page. After confirming, the message is in your inbox and your dashboard. Send one more from your custom domain, if you have one.

Common problems

  • 403 origin_not_allowed. The page's origin isn't in Allowed origins. A preview needs the *.PROJECT.pages.dev entry, and a custom domain its own. See troubleshooting and errors.
  • You see our thank-you page, not yours. The _redirect value is relative or on another origin.
  • The form sends but no email arrives. The address hasn't confirmed yet. Look for the email from Wrenform, also in spam.
  • Your framework submits the form itself. Remove its submit handler, or send the form with fetch as in redirects.

Next steps

Something wrong or unclear on this page? Report a problem: write to hello [at] wrenform.com with the page address (/docs/guides/contact-form-cloudflare-pages).