Skip to content
Wrenform

Docs / Hosting

Contact form for Cloudflare Pages

Post a plain HTML form to Wrenform from a Pages site. No Function, mail provider or spam handling to build.

Last updated 2026-11-17View as Markdown
<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>

Steps

  1. Create a form and copy its form ID, or let your AI tool create one without an account.
  2. Put the form in any page of your site, with your form ID in the action. It's plain HTML, so it works with any framework or none.
  3. Add a thank-you page, for example thanks.html, and set its full address as the form's Redirect to, for example https://PROJECT.pages.dev/thanks.html or your custom domain. See redirects.
  4. Deploy as usual.
  5. In the form's settings, add your site under Allowed origins: https://PROJECT.pages.dev, and your custom domain if you have one.

Preview deployments

Preview and branch deployments get their own subdomains of PROJECT.pages.dev. To accept submissions from them too, add https://*.PROJECT.pages.dev under Allowed origins: it matches every subdomain, but not https://PROJECT.pages.dev itself, so keep that entry as well. Or test from production only.

Ask your AI

Add a contact form to this Cloudflare Pages site using Wrenform. Use plain HTML that posts to https://wrenform.com/f/YOUR_FORM_ID with method POST, with name, email and message fields and the hidden _honey field. Add a thank-you page. Don't write a Pages Function or use mailto. Then tell me to add the site's address under Allowed origins in Wrenform.

No form ID yet? The prompts for AI builders let the tool create one without an account.

When a Function is the better fit

If you need to change the data, or write it to your own database, before anything is sent, write a Pages Function for that instead. When a form only needs to reach your inbox, plain HTML posting to Wrenform is enough.

Test it

Open the deployed page, send the form, and you should land on your thank-you page. The submission shows in your dashboard and arrives by email. The first time, confirm the recipient address from the email we send.

Common problems

  • origin_not_allowed. The page's address isn't under Allowed origins. A preview deployment needs the *.PROJECT.pages.dev entry above. See errors.
  • You see our thank-you page, not yours. Redirect to is empty, or it isn't an https:// address.
  • No email arrives. The recipient hasn't confirmed yet. See notifications.

Next steps

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