FeaturesCommunityGuidesUse casesCompareToolsBlogPricing
Orlume logo

How to add a contact form to a static website

Add a contact form to a static site without a server: your host's built-in forms, a form service like Formspree, or a small serverless function.

The short answer

A static site has no server to receive form data, so you hand the submission to something that does. The three common options are your host's built-in forms (Netlify Forms works by adding one attribute), a form backend service such as Formspree that emails you each submission, or a small serverless function you write. All three work with plain HTML, and the first two need no code beyond the form itself.

  • Netlify Forms: add a netlify attribute; submissions appear in Netlify's dashboard.
  • Formspree's free plan allows 50 submissions a month, per its plans page.
  • Serverless functions give full control for a little code.
  • Add spam protection (a honeypot field or a challenge) from day one.

01The three options

Contact forms for static sites, as of October 2026
OptionHow it worksBest forWatch out for
Host forms (Netlify)Host detects the form at deploy and stores submissionsSites already on NetlifyTied to that host
Form service (Formspree and similar)Form posts to the service, which emails or stores itAny host, no codeFree tiers are small
Serverless functionYour function receives the post and sends an emailDevelopers wanting controlYou maintain it and handle spam

02Option 1: Netlify Forms

If your site is on Netlify, add the netlify attribute (or data-netlify="true") and a name to your form tag. According to Netlify's documentation, its build system detects the form at deploy time, injects a hidden form-name field, and stores submissions you can view and forward by email. Forms rendered only by JavaScript need a hidden static copy so the scanner can find them.

Netlify's April 2026 pricing update made form submissions free on its credit-based plans; older accounts may still be on legacy limits.

03Option 2: A form backend service

Services like Formspree give you an endpoint URL; set it as your form's action and submissions arrive by email or in a dashboard. It works on any host, including GitHub Pages and Cloudflare Pages. Formspree's plans page lists a free plan of 50 submissions a month, described as for testing and development, with paid plans for more.

  1. 1Create a form in the serviceYou get a unique endpoint URL.
  2. 2Point your form at itSet the form's action to the endpoint and method to POST.
  3. 3Name your fieldsname, email and message attributes become the labels in your email.
  4. 4Add a thank-you pageRedirect to a simple confirmation so people know it worked.
  5. 5Test from a phoneSubmit once from a real device before launch.

04Option 3: A serverless function

Most static hosts can run small functions on request. A function can receive the form, validate it, and send an email through a transactional email service. This gives full control over fields, validation and where data goes, with a little code and an email provider account. It suits developers who want no third-party form service in the middle.

05Stopping spam

Public forms attract bots within days. Add a honeypot (a hidden field real people leave empty), use your service's built-in spam filtering, and consider a lightweight challenge if spam persists. Avoid publishing your email address in plain text on the page; the form exists partly to protect it.

  • Honeypot field: hidden from people, filled in by bots.
  • Built-in filtering: most services and Netlify include it.
  • Challenges: add one only if simpler methods fail, since they add friction.

06Making the form itself work well

Ask only for what you need (name, email, message is usually enough), label every field visibly rather than relying on placeholder text, show clear errors and confirm success. If the form collects personal data, link a privacy policy nearby; does a website need a privacy policy? explains when that is required. For the bigger picture of static sites, see static vs dynamic website and how to host a website for free.

What people who tried it say

Developers on Hacker News who build static sites typically recommend a hosted form service or the host's own form handling for simple contact forms, and a small serverless function when they want to avoid third parties.

Looking for more first-hand opinions? Search Reddit for “how to add a contact form to a static website”. We link the live threads rather than summarizing them, so you read them in full.

Our take

use your host's built-in forms if it has them, a form service if it does not, and write a function only when you have a reason. A contact form is not where to spend engineering time.

Where this falls short

Free-tier limits and pricing for form services and hosts change often; Netlify changed its form pricing in April 2026. Check current terms, and remember that any service receiving submissions also handles your visitors' data.

Where Orlume fits

Sites built with Orlume can include a contact form from the prompt, and are published in one click, so you do not wire up a form service by hand.

Free to start · No card required · Live in one click

Sources

  1. 1.Forms setup · Netlify Docs
  2. 2.Pricing updates, April 2026 · Netlify
  3. 3.Formspree plans · Formspree

Orlume logoResearched and written by the Orlume team · Updated October 2026

More on building a website

All 12 building a website questions →
Questions

People also ask.

More on how to add a contact form to a static website, answered briefly.

Can a static website have a contact form?

Yes, by sending submissions to your host's form handling, a form service or a serverless function.

What is the easiest way to add a form to a static site?

On Netlify, add the netlify attribute to the form. On other hosts, point the form at a service like Formspree.

Is Formspree free?

It has a free plan with 50 submissions a month, per its plans page; paid plans add more.

How do I stop spam on my contact form?

Add a honeypot field, use built-in spam filtering, and add a challenge only if spam continues.

Orlume logoStill stuck? Email us
Orlume logo

Build something that doesn't look AI-made.

Describe the site you want. Watch it get designed, not just generated. Then publish it to its own orlume.site address.

  • Free to start
  • No card required
  • Publish to a live URL
  • You own the code