Skip to content
Wrenform

Contact forms / HTML

HTML contact form without a backend

Paste one <form> into any page. Submissions arrive by email and in a dashboard, with spam filtered out.

Why HTML needs a form backend

An HTML form needs somewhere to send its data. On a static site there is no server to receive it, and the old answer, a PHP mail() script, needs a server, a mail setup and its own spam defence.

Wrenform is that receiving end. Set the form's action to your endpoint and the browser posts straight to us. We store the submission, filter spam and email it to you. Your site stays plain HTML.

The snippet

Replace YOUR_FORM_ID with the ID of your form.

<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 (free) and copy its form ID.
  2. Paste the snippet and replace YOUR_FORM_ID. Keep every name attribute and the hidden _honey field.
  3. Upload the page to your host and send a test.
  4. Add your site's origin under Allowed origins so other sites can't use your form.

Spam handling

Spam filtering is on for every form, with no CAPTCHA: a hidden honeypot field, a timing check, rate limits per visitor, and a content score for links, keywords and gibberish. Spam goes to a separate tab and is never emailed. See how spam filtering works.

Sites with a strict Content-Security-Policy can use a version with no inline style and no script. It only needs form-action https://wrenform.com in the policy.

Deployment notes

  • Netlify. Deploy as usual. Netlify only processes forms that carry its own netlify or data-netlify attribute, so it leaves this form alone and the browser posts it to Wrenform. Add your netlify.app address and your custom domain to Allowed origins.
  • Vercel. Nothing to configure. The site build stays static; you don't need a serverless function for the form. Add your production domain to Allowed origins. Preview deployments get their own addresses, so leave the list empty while you test them, or add each one.
  • Cloudflare Pages. No Pages Function needed. Add your pages.dev address and your custom domain to Allowed origins. If you set a Content-Security-Policy header, add form-action https://wrenform.com.
  • GitHub Pages. GitHub Pages serves static files only, which is all this form needs. Add https://<user>.github.io (or your custom domain) to Allowed origins. The origin is the host only, without the repository path.

FAQ

Do I need JavaScript for an HTML contact form?
No. A plain form with method POST works on its own: the visitor sends it, lands on a thank-you page, and you get the email. JavaScript is only needed if you want to stay on the page.
Can I send visitors to my own thank-you page?
Yes. Set Redirect to in the form's settings, or add a hidden _redirect field with a full URL on one of your allowed origins.
Will it work if I open the HTML file from my computer?
No. Requests from local files have a null origin and are always rejected, because that is how phishing attachments post stolen data. Test from a web server.
Is the form ID a secret?
No. It is meant to sit in your HTML. Allowed origins stop other sites from posting to your form.

Next steps