Add a contact form to any static site.
A static site contact form works by pointing a plain HTML form at a hosted backend instead of a server script, since GitHub Pages, Astro, Hugo, Eleventy, and Jekyll can't run one. splitforms is that backend: set the form's action to https://splitforms.com/api/submit, add your access_key as a hidden field, and every submission is delivered to your inbox and the splitforms dashboard — no serverless function, PHP, or SMTP setup required.

Works on hosts that only serve files.
Static hosts cannot process POST requests themselves — they only serve files. The fix is to send the browser's POST straight to a form backend built for that job, so nothing runs on your host.
<form action="https://splitforms.com/api/submit" method="POST">
<input type="hidden" name="access_key" value="YOUR_ACCESS_KEY" />
<input type="hidden" name="redirect" value="https://yoursite.com/thanks" />
<input name="name" placeholder="Name" required />
<input name="email" type="email" placeholder="Email" required />
<textarea name="message" placeholder="Message" required></textarea>
<input type="checkbox" name="botcheck" style="display:none" tabindex="-1" />
<button type="submit">Send message</button>
</form>Prefer fetch? Get JSON instead of a redirect.
An Astro island, an Eleventy page with a small script, or a plain <script> tag can POST the same form with fetch() and show an inline success message instead of redirecting. Both the HTML action and the fetch call hit the same https://splitforms.com/api/submit endpoint, so you can start with the plain HTML form above and upgrade later without changing your field names.
const res = await fetch("https://splitforms.com/api/submit", {
method: "POST",
headers: { Accept: "application/json" },
body: new FormData(form),
});
const data = await res.json();
// data.success === true once splitforms accepts the submissionStop spam on a static contact form without CAPTCHA.
splitforms layers three defenses that all work on a purely static page: a hidden botcheck honeypot field that must stay empty, server-side content heuristics that run on every submission automatically, and rate limiting of 6 submissions a minute and 20 per 15 minutes per IP. If your static site can run one line of JavaScript, add a form_loaded_at hidden field set to the page-load timestamp — splitforms uses it as a time-trap to catch bots that submit in under a second. None of this requires a CAPTCHA, though optional reCAPTCHA v2 is available as an extra layer, and per-form allowed-domains or strict origin mode blocks other sites from reusing your access_key.
Contact form guides for every static site generator.
Every generator wires the same access_key and redirect fields into a slightly different template — pick your stack for copy-paste code.
How to add a contact form to a static site.
Five steps, no server code of your own — the same path works whether your site is pure HTML or a generator like Hugo or Astro.
Create a free splitforms account and access key
Sign up and create a form in the dashboard. Free covers 500 submissions a month on unlimited forms, with email notifications and spam filtering included and no credit card required. Copy the form's access_key.
Paste the HTML form into your static template
Add a plain <form action="https://splitforms.com/api/submit" method="POST"> to your GitHub Pages, Astro, Hugo, Eleventy, or Jekyll template — no build step, API route, or serverless function required.
Add the access_key, redirect, and honeypot fields
Set access_key as a hidden field so splitforms knows which form is submitting, add a redirect field with your thank-you page URL, and include a hidden botcheck input that must stay empty to catch bots.
Rebuild and deploy your static site
Push to GitHub Pages, Netlify, Cloudflare Pages, S3, or your host of choice. The form posts directly to splitforms, so there is nothing server-side to configure on the host itself.
Send a test submission and check the dashboard
Submit the live form once. Confirm the lead lands in your inbox and the splitforms dashboard, then turn on allowed-domains or strict origin mode in the form's settings to block spoofed submissions from other sites.
Frequently asked questions about static site contact forms.
How do I add a contact form to a static site?
Add a normal HTML form that POSTs to https://splitforms.com/api/submit, with a hidden access_key field identifying which splitforms form receives it. No serverless function, PHP, or SMTP setup is needed — submissions land in your inbox and the splitforms dashboard.
Does this work on GitHub Pages?
Yes. GitHub Pages only serves static files and can't run a form handler, but it can still POST to an external endpoint. Point the form's action at splitforms and it works the same way on Jekyll, Hugo, Eleventy, or any other static host.
Do I need JavaScript?
No. A native HTML form submit works with zero JavaScript, and the botcheck honeypot field filters spam without any script running. Add a line of JavaScript only if you want the optional form_loaded_at time-trap field or a fetch-based inline success message — neither is required.
How do I prevent spam on a static contact form?
splitforms layers static-friendly defenses: a hidden botcheck honeypot field that must stay empty, server-side content heuristics on every submission, and rate limiting of 6 submissions a minute and 20 per 15 minutes per IP. Add the form_loaded_at time-trap field or optional reCAPTCHA v2 for extra coverage — none of it requires a JavaScript framework.
Can I submit with fetch and get a JSON response instead of a redirect?
Yes. POST a FormData body to https://splitforms.com/api/submit with an Accept: application/json header from a fetch() call, and splitforms returns a JSON response you can use to show an inline success message instead of redirecting the page.
Is there a free plan for a static site contact form?
Yes. Free covers 500 submissions a month across unlimited forms, with email notifications, spam filtering, and dashboard storage included — no credit card required. Starter ($1/mo) adds CSV/XML/PDF exports, webhooks, integrations, and auto-responder at 1,000 submissions a month.
Can I customize the email subject or redirect visitors after submit?
Yes. Add hidden subject, redirect, and replyto fields to the form. subject sets the notification email's subject line, redirect sends visitors to your thank-you page after submit, and replyto sets the reply-to address so you can respond directly from your inbox.
Add a contact form to your site.
500 submissions per month, no credit card required.