Your contact form after the move: keep the leads, drop the junk

Cartoon of a small business owner holding an inbox tray of real messages while a sorting mailbox drops junk into a bin

In our post on giving an AI-built website a real home, the first item on the “check these before you move” list was the contact form. If the builder handled your messages, they stop arriving the day you leave. Nothing on the page tells you. The form still looks fine, and the visitor still sees “thanks, we’ll be in touch”.

That is the worst kind of broken: quiet. A missed phone call at least shows up in your call log. A missed form fill just looks like a slow month.

This post is the follow-up. It shows how we run the forms on our own lead-generation sites: a small piece of code on Amazon Web Services that saves every message, sorts out the junk, and emails you the real ones. It costs pennies a month. It is written for business owners and for whoever builds or looks after your site.

The short version

  • A form needs somewhere to send its message. On a builder, that’s the builder. On your own hosting, it’s a small program you run.
  • On AWS that takes four pieces: a front door for the form, a short program, a table to keep every message, and an email service to tell you about the real ones.
  • Save everything, then sort. Junk is labelled and kept, not thrown away, so a real customer who looks odd can still be found.
  • Junk is caught in layers. No single check decides; small signs add up.
  • Caps on every part that costs money, so a flood of junk can’t run up a bill or bury your inbox.
  • For a local business’s volume, the AWS cost rounds to zero.

Your options when the builder’s form goes away

There are two sensible routes.

A hosted form service. You point your form at someone else’s address and they email you the messages. If you get a handful of messages a month and nobody on your side is technical, this is fine. You are back to renting, though: their limits, their spam filter, their price changes.

Your own small backend. A few pieces in your own AWS account, next to the site itself. You decide what counts as junk, you keep every message, and the data stays yours. This is what we run. The rest of this post is how it works.

The four pieces

Plain terms first, with the AWS names in case anyone asks:

  1. A front door for the form (Amazon API Gateway). The form posts to an address on your own domain, like yourbusiness.com/api/lead. The same delivery network that serves your pages passes it through. To the visitor’s browser it is all one site.
  2. A short program (AWS Lambda). It runs only when someone submits, checks the message, decides whether it looks real, and passes it on. There is no server sitting there waiting, and nothing to patch.
  3. A table that keeps every message (Amazon DynamoDB). Every submission is saved, real or junk, with a note of why it was judged the way it was. We also switch on its point-in-time backup, so a mistake can be rolled back.
  4. An email service (Amazon SES). It sends you a plain-text email for each real message, with Reply-To set to the visitor. You hit Reply and you are talking to your customer.

One order matters more than anything else in this list: save first, then notify. The message is written to the table before any email goes out. If the email fails for any reason, the lead is still there.

Save everything, then sort

Most form setups make a yes-or-no call: real messages get through, junk gets deleted. The trouble is that spam filters are sometimes wrong, and a deleted lead is gone for good.

So ours never deletes. Every submission is stored with a junk score and the reasons behind it, in plain words like “posted without the page’s script” or “email domain can’t receive mail”. Real ones are emailed. Junk is kept and labelled, and never emailed. When someone says “I filled in your form last week”, you can look, and if the filter got it wrong you still have their message.

Keeping the junk has a second benefit: you can see how much of it there is. When our lead-generation sites ran on an older WordPress setup, their forms took in about a hundred junk entries a month and no real ones. That number is what told us the old forms weren’t worth keeping.

How the junk gets caught

There is no single trick that stops form spam. What works is several cheap checks, each worth a few points, added up. One odd thing on its own (a ZIP code just outside your area, a single link in the message) never marks a real person as junk. Two or three together usually means a bot.

These are the layers, without the exact settings, since publishing those would only help the people we’re filtering out:

  • A hidden field. The form has a box that people never see. Bots fill in every box they find. On its own this isn’t proof, because browser autofill sometimes fills hidden boxes too, so it counts as one strong sign, not a verdict.
  • Time on our clock, not theirs. When someone first clicks into the form, our side hands the page a signed timestamp. When they submit, we check how long it took. People take a while to type. Bots fill a form in a blink, and they can’t fake the signature to claim they took their time.
  • Did it come from the page? A real visitor’s browser runs the page’s own script and says which site it is posting from. A program posting straight at the form address usually does neither.
  • A private handshake. The delivery network adds a secret to every request it passes along. A request that skipped the website and went straight to the backend doesn’t have it, so it is marked as junk and kept, not trusted.
  • Does the contact information hold up? A phone number that can’t exist, a ZIP code that isn’t a ZIP code, an email from a throwaway-address service, or an email domain with no mail server behind it.
  • What the message says. The “I came across your website” pitches, link-stuffed messages, and sellers of email lists all have a recognizable way of writing. A customer describing their own job sounds different from a company selling something.
  • Repeats. The same sender trying several times in one day.
  • A captcha, kept in reserve. The setup supports Cloudflare’s Turnstile, but we leave it off. It’s one more thing a real customer has to deal with, and the checks above have been enough.

How well does it work? Through October 1, every one of the 58 junk submissions across our four older sites was caught, and none reached us. In late October a few scripted sales pitches did get through. They were posted by a program that skipped the page, and they tripped only two of the layers. We added a rule for that combination the same week. That’s the point of keeping the junk with its reasons: when something slips through, you can see exactly why, and fix that one gap.

One more rule worth copying: every outside check fails open. If the service that looks up email domains is down, the answer is “unknown”, not “junk”. An outage on someone else’s side should never turn your real customers into spam.

Caps, so a flood can’t cost you

Anything on the internet that accepts messages will eventually get hammered. The goal is that a flood of junk is boring: it can’t run up a bill and it can’t bury your inbox.

  • Per visitor, per hour. After a few submissions in an hour from the same address, the form politely says “try again later”.
  • Per sender, per day. Repeat submissions from the same address or the same email in one day count against the message.
  • A ceiling on the whole thing. The front door only accepts a small number of form posts per second, and only a handful of copies of the program can run at once. That puts a hard ceiling on what even a determined flood can cost.
  • Junk never sends email. Only messages that pass get emailed, so your inbox, and your email service’s sending record, stay clean.
  • Size limits. Every field has a maximum length and the whole message has a size limit, so nobody can post a novel or a file.

Small things that make it trustworthy

  • We don’t store visitors’ IP addresses. The caps above work from a scrambled, one-way version of the address, and it deletes itself within two days.
  • Plain-text email only. Whatever a visitor types is treated as text, never as a web page, so a message can’t hide a fake link or a script.
  • It works with scripts turned off. If the visitor’s browser blocks the page’s script, the form still posts the old-fashioned way and lands on a thank-you page.
  • Consent is recorded exactly. If your form has an “OK to contact me” box, the backend stores only a clear yes, with when and on which page it was ticked.

What it costs

For a small business, very little. These are AWS’s published prices as of November 2026:

  • The front door (API Gateway, HTTP API): $1.00 per million requests, from AWS’s API Gateway pricing page.
  • The program (Lambda): $0.20 per million requests plus a small charge for running time. Lambda’s free tier includes one million requests and 400,000 GB-seconds of running time a month (Lambda pricing).
  • The table (DynamoDB, on-demand): $0.625 per million writes in US East (N. Virginia), and 25 GB of storage is in the free tier (DynamoDB on-demand pricing).
  • The email (SES): $0.10 per 1,000 emails (SES pricing).

Put a busy month of 300 submissions through that and the email comes to about three cents. The rest is fractions of a cent. New AWS accounts also get up to $200 in free-tier credits to use in their first year.

Before you switch it on

  1. Get your email service out of the sandbox. A new SES account starts in a “sandbox”: it can only send to addresses you have verified, at most 200 messages a day and one a second (AWS’s sandbox page). If you only ever email yourself, that is enough. If anyone else should get the messages, ask AWS for production access. Their support team answers within 96 hours.
  2. Send from your own domain, properly signed. Set up DKIM for the sending address so the notifications don’t land in your own spam folder.
  3. Keep secrets off the page. The form should post to your own domain with no password or key in the page’s code. Anything a visitor’s browser can read, a spammer can read too.
  4. Test it like a customer. Fill in the form from your phone, on cellular, with your real details. Then reply to the notification and make sure the reply reaches you.
  5. Look at the junk pile now and then. Once a week is plenty. If a real customer is sitting in it, you’ll see the reason it was flagged, and you can adjust that one check.

Rather we set it up?

That’s the kind of thing we do. 45Squared builds, hosts and looks after websites for small businesses, and we can put this same setup behind your form: every message kept, only the real ones in your inbox.

Not sure your form is reaching you at all? Use the form below to send us your website’s address, and we’ll tell you what it needs.