# 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-17. Web version: https://wrenform.com/docs/hosting/cloudflare-pages

```html
<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](/sign-in) and copy its form ID, or let your AI tool create one [without an account](/docs/quick-forms).
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](/docs/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

```text
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](/docs/ai) 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](/docs/errors#origin_not_allowed).
- **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](/docs/notifications).

## Next steps

- [My form isn't working](/docs/troubleshooting): symptom, cause and fix.
- [Spam](/docs/spam): the honeypot, and the optional helper script that adds a timing check.
- [Fields](/docs/fields): subjects, reply-to and lists.
- [GitHub Pages](/docs/hosting/github-pages), [Vercel](/docs/hosting/vercel) and [Netlify](/docs/hosting/netlify): the same form on other hosts.
