How to add forms to a static site

Static sites (HTML, Jekyll, Hugo, Eleventy) don't have a backend to process form submissions. LazyForms gives your static site a form backend — just point your form action to our endpoint and submissions go to your inbox, Google Sheets, or webhook.

Why static sites need a form backend

Static site generators output plain HTML files. There's no server-side code to receive a POST request, validate data, send emails, or store submissions. You need an external service to handle form processing.

Options include building your own API, using a serverless function, or using a form backend service like LazyForms. A dedicated service is the fastest path — no infrastructure to maintain.

Step 1: Create your form endpoint

Sign up at lazyforms.com (just enter your email — no password). Create a new form in your dashboard and copy the access key. Your endpoint URL is:

https://api.lazyforms.com/f/YOUR_ACCESS_KEY

Step 2: Add the HTML form

Add a standard HTML form to your static site. Set the `action` attribute to your LazyForms endpoint and `method` to `POST`:

<form action="https://api.lazyforms.com/f/YOUR_ACCESS_KEY" method="POST">
  <input type="text" name="name" placeholder="Name" required />
  <input type="email" name="email" placeholder="Email" required />
  <textarea name="message" placeholder="Message" required></textarea>
  <button type="submit">Send</button>
</form>

Every field with a `name` attribute will be captured in your submission.

Step 3: Configure notifications

In your LazyForms dashboard, configure how you want to receive submissions:

  • Email notifications — get an email for every submission
  • Google Sheets — auto-sync submissions to a spreadsheet
  • Webhooks — POST JSON to your own URL for automation

All three can be active simultaneously.

Step 4: Add spam protection

Enable the honeypot field in your form settings, then add a hidden input to your form:

<input type="text" name="_honey" style="display:none" tabindex="-1" />

Bots fill in all fields — real users never see this one. LazyForms rejects submissions where `_honey` has a value.

For stronger protection, enable Cloudflare Turnstile in your form settings and add the Turnstile widget to your page.

Step 5: Custom redirect (optional)

By default, LazyForms shows a success page after submission. To redirect users back to your site, set a redirect URL in your form settings:

https://yoursite.com/thank-you

Or use AJAX submission (fetch) to stay on the same page without any redirect.

Works with any static site generator

This approach works with:

  • Plain HTML/CSS sites
  • Jekyll (GitHub Pages)
  • Hugo
  • Eleventy (11ty)
  • Astro (static mode)
  • Gatsby
  • Any tool that outputs HTML files

If your site can render an HTML `<form>` tag, it works with LazyForms.

Ready to get started?

Get your form endpoint in seconds. Free forever.

Enter your email to receive your form action URL · No password needed

More guides