KG-SCRIPTS / BLOG
1 August 2026
3 min read
Stop spam in your forms without frustrating real users. Learn practical methods like honeypot fields, time checks, and smarter CAPTCHA use.
Spam in your contact form, order form, or newsletter signup is more than an annoyance. It pollutes your database, creates fake inquiries, and can hide real clients. A bot doesn't want anything from you, but it takes time from you or your team. It's worth stopping most of it at the front door.
One of the most effective ways to stop automated spam is a honeypot. It's a hidden field in your form that people can't see and never fill in. Bots, however, often fill every field. If the field isn't empty, simply don't submit the form.
For example, add a hidden input named website or company_website and hide it with CSS. This doesn't ask the user to solve anything and doesn't hurt accessibility.
Real users need a few seconds to fill out a form. Bots submit it instantly. You can record the time the form was loaded and compare it with the submission time. If the difference is less than three seconds, it's likely spam.
This check is usually easy to add with a bit of JavaScript and doesn't require external services.
CAPTCHA solves the problem but creates friction for people. So don't put it on every form. A contact form is rarely attacked as heavily as a registration or comment form.
If you do need it, choose a lighter option—for example, an image task that requires one click instead of typing distorted text. Modern versions of Google reCAPTCHA and alternatives like Cloudflare Turnstile are much friendlier to users.
Many spam messages come from fake email addresses. You can check the email format, such as whether it contains @ and a valid domain. If you have a more complex form, add a DNS lookup to verify that the domain exists.
This won't stop every bot, but it filters out clearly invalid addresses.
Automated attacks usually come from the same IP addresses. You can limit how many submissions per hour one IP address can make. If the limit is exceeded, show an error message.
This is especially useful for subscription forms, where a real user rarely needs to submit ten times.
For forms that lead to subscriptions or registrations, add an email confirmation step. After a user submits the form, send them a link. If they don't click it, the data isn't saved.
This makes the process more secure and reduces fake contacts. The downside is that real users have to take one extra step, so use it only when data quality matters.
No solution is perfect. Check your form submissions periodically. If you notice patterns, add extra protection.
Many platforms show the IP address and time of each submission, so you can tell whether it's a bot or a person.
Form spam never disappears completely, but with a honeypot, a time check, and a sensible CAPTCHA policy, you can significantly reduce the noise. Start with the easiest steps and add protection only where you see a problem. That keeps your forms convenient for customers and saves time for your team.
If you'd like help setting this up, the team at KG-SCRIPTS can review your forms and suggest a proper solution.