ROOTCR HU

How does a quote request form protect against spam? The five layers

In short: A form isn't protected by a single solution but by a series of layers: origin checking, a hidden honeypot field, a size limit, human verification, and IP-based limiting. Order matters: up front are the cheap checks that can be decided from reading a single header, at the back the expensive ones that call an external service. This way an attacker can't put your server to work, and genuine prospects don't get stuck either.

Why isn't a single solution enough?

Because attackers aren't all alike either. The simple form-filling bot fills in every field and submits — a hidden field catches that. The targeted script already imitates the browser — only human verification catches that. And mass attempts aren't even about content but about tying up your server.

A single solution always protects against only one type of attack. What you need to build isn't a wall but a series of filters.

The five layers, in order

1. Origin check

On every submission, the browser reveals which page the request came from. If it's not from your own page, the server rejects it — before it reads anything out of the data.

Cost: comparing one header. Practically free. What it catches: submissions aimed directly at the endpoint from elsewhere.

2. Honeypot field

A hidden field that a human never sees and never fills in — the browser hides it from the screen, and it's excluded from keyboard navigation too. The automated filler, however, reads the HTML, not the screen, so it fills it in.

One important detail: if the trap signals, the response should be “successful.” If you return an error, the bot's developer learns what gave it away and will bypass it next time.

Cost: checking one field. Free. What it catches: most of the mass-filling bots.

3. Size limit

An overly large request body shouldn't even reach the application: let it get stuck at the server level. This doesn't primarily protect against spam but against someone tying up your memory and bandwidth.

Cost: one setting on the server. What it catches: load attempts and the waste caused by faulty clients.

4. Human verification

This is where the picture comes into the picture — or more precisely: these days no image selection is needed. Modern solutions (such as Cloudflare Turnstile) decide based on browser behavior, without cookies and without harassing the visitor. This is the most important reCAPTCHA alternative, and cleaner from a data protection standpoint too.

Cost: a network call to an external service, with a time limit. This is the most expensive step — that's why it's at the back. What it catches: targeted scripts that imitate the browser.

5. IP-based limiting

A limited number of submissions per address within a given time window. Not the bots' main filter but protection against whatever remains, and at the same time the protection of the expensive steps.

Cost: a counter held in memory. What it catches: repeated attempts from the same address.

Why does order matter?

Because every check has a cost, and the attacker wants exactly that paid by you. If human verification (the external call) runs before the IP limit, then anyone sending one request per second forces one outgoing network call per second from your server. The protection becomes the source of the load.

So the correct order is: cheap checks up front, expensive ones at the back, and the counter still before the expensive ones. That's the difference between “I use five layers” and “I use five layers well.”

What else is worth doing

  • Save first, then email. Let the incoming inquiry go to disk, and only then send the notification email. If the email-sending service goes down, the prospect still isn't lost.
  • Alert on silent failure. If saving succeeded but the email didn't go out, you need to know immediately. The most expensive error is the one nobody talks about.
  • Confirmation email to the prospect. Not politeness: this closes the uncertainty of “did it arrive at all.”
  • Retention period. An incoming inquiry is personal data. Give it a deadline, and let it expire on its own.
  • Logging without password or cookie. Whatever isn't needed, don't store it.

Here's what all of this looks like in production: pekarunagyker.hu case study.

Frequently asked questions

Isn't reCAPTCHA enough?

A single layer is never enough on its own, and reCAPTCHA burdens the user too. Cookie-free, behavior-based verification is a better trade today — but that too is only one layer out of five.

Won't genuine prospects get stuck?

For the first three layers, the real visitor is invisible: they need to do nothing. With a good implementation, the fourth layer is one click for most visitors — or not even that. The fifth layer only flags when someone sends for the umpteenth time within an hour.

How much does this cost?

If the form is part of the build, then nothing: for me this is standard equipment on every custom website. Retrofitted into an existing system, a few hours of work.

Updated: August 23, 2026

Got a project that fits?

Describe it in a few sentences. I reply within one business day, tell you whether I can help, and give you a ballpark figure. If it is not a fit, I say that too.

Request a quote