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
- Create a form (free) and copy its form ID.
- Paste the snippet and replace
YOUR_FORM_ID. Keep everynameattribute and the hidden_honeyfield. - Upload the page to your host and send a test.
- 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
netlifyordata-netlifyattribute, so it leaves this form alone and the browser posts it to Wrenform. Add yournetlify.appaddress 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.devaddress and your custom domain to Allowed origins. If you set a Content-Security-Policy header, addform-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?
Can I send visitors to my own thank-you page?
Will it work if I open the HTML file from my computer?
Is the form ID a secret?
Next steps
- The full HTML guide: every option, testing, and common problems.
- Contact form for Hugo without a server
- Contact form for Astro without a backend
- Pricing: free for 250 submissions a month.