AI websites

Step-by-step tutorial

Reduce Contact Form Spam on Your AI Website

Filter junk submissions on a working contact form, keep genuine enquiries arriving, and test a small anti-spam change before publishing it.

Product links on this page are ordinary official links. No affiliate commission is currently attached. Read our disclosure.

Quick answer

If your form already delivers genuine enquiries but also receives junk, change the filtering at the service or server that receives it. A different button or a hidden field alone cannot make that receiver filter anything.

  1. Identify the receiver and save one successful, harmless enquiry.
  2. Use its existing anti-spam controls before adding another service.
  3. Make one small change, such as a supported honeypot.
  4. Check a normal enquiry, the filter’s documented behaviour, and keyboard access.

This guide addresses spam on a working form. If messages do not arrive at all, start with our contact-form repair guide.

Step 1: Find where the spam enters

Keep one recent example and note when it arrived. Remove personal details before showing it to an AI assistant.

Then identify where submissions go: a form service, your own server, or a hosted builder’s form feature. Ask your coding assistant to find the destination in your actual project; do not infer it from how the page looks.

Check the receiver’s records against the unwanted message:

  • The receiver recorded it: investigate that form’s filtering.
  • Only an inbox message exists: it might be direct email spam. Do not assume the website form sent it.
  • Several forms share the inbox: identify which form needs changing first.

Use an address you control to send one ordinary test through your own form. Record the time, the fields received and the inbox result. That is your baseline: the repair should preserve this visitor journey.

If you cannot establish normal delivery, resolve that problem before judging whether an anti-spam change works.

Step 2: Choose one supported control

Open the current help for the receiver you actually use. Look for its spam settings, existing challenge integration or supported honeypot field.

A honeypot is an extra field that people normally leave empty. Some automated submissions fill it. The receiver must recognise and act on it. A random field called “spam check” has no special power.

For example, Formspree documents a field named _gotcha. If that field is filled, its servers silently ignore the submission. The documentation lists the feature on all plans.

That is a Formspree rule, not a universal HTML standard. A different service may use another field or a dashboard setting. A custom backend needs its own server-side check.

Preserve any protection already working. Do not remove the provider’s existing challenge just to make a new example match a tutorial. Keep a recoverable version using the safe website update process.

Step 3: Add the small change

If your existing receiver is Formspree, ask your assistant to add its supported field inside the existing form. Preserve the form’s destination, normal field names and notification settings.

This example adds only the trap; it is not a replacement form:

<div class="form-trap" aria-hidden="true">
  <label>
    Leave this blank
    <input
      type="text"
      name="_gotcha"
      tabindex="-1"
      autocomplete="off"
    >
  </label>
</div>
.form-trap {
  display: none;
}

The field must remain empty for a normal visitor. Do not mark it required, give it a default value, or accidentally show it as a question people should answer.

For a JavaScript form, ask your assistant to inspect the request as well as the HTML. If the script builds a fixed list of fields, adding an input to the page may not add it to the submitted data.

For a visual builder, use its supported controls. Do not paste this field into a platform that does not document recognising it.

Use this prompt in your existing website project:

My contact form works, but receives spam.
Find the actual receiving service or server.

Check its current official anti-spam instructions.
Propose one small supported change.
Preserve normal fields, destination, notifications and design.
Keep private credentials on the server.

Show the diff and a preview. Check that a genuine enquiry
still arrives and that keyboard users can submit normally.
Report what was actually tested and what remains unknown.
Do not publish until the change has been reviewed.

A hidden control is not a secret. Visitors can inspect browser-delivered HTML. Keep private keys out of it; our exposed-key guide explains that separate issue.

Step 4: Check the genuine visitor first

Open the preview and submit another harmless enquiry using an address you control. Match the receiver’s record and notification to your test time.

Then put the mouse aside. Use Tab to reach the normal fields and Submit. The trap should never appear as an extra field the visitor must complete.

Also check a narrow phone preview. A new challenge, field or error message must not cover the Submit button or prevent the message being entered.

For the filtering check, use the provider’s documented test procedure or a disposable copy of your own receiver. Do not run a flood of junk through a production form. One controlled test can reveal a configuration mistake without creating a new inbox problem.

Record the actual result at the receiver. A pleasant success message is insufficient: a filter may deliberately acknowledge a submission while not storing or forwarding it.

If a genuine enquiry stops arriving, restore the previous version and inspect that change before adding another layer.

Worked example: what our local test showed

We tested a fictional workshop form in an isolated local browser demonstration. It had Name, Email and Message fields, plus a hidden trap. A local receiver stored submissions only when the trap was empty.

The normal browser enquiry used these prepared details:

Name: Jordan Example
Email: [email protected]
Message: Please send the workshop times.
Honeypot: empty

The receiver stored that enquiry and returned “Thanks. Your test was received.”

We then sent two simulated requests to the same local demonstration, not a real business’s form:

Local case Trap value Observed result
Ordinary browser enquiry Empty One record stored
Simulated junk request Filled No additional record stored
Simulated request avoiding the trap Empty Another record stored

The filled-trap case received the same generic acknowledgement. That demonstrates why the page’s message cannot establish delivery.

The third case matters just as much: an automated request can leave the trap empty. The field did not distinguish every bot from every person.

In the keyboard check, focus reached Name, Email, Message and Send test without entering the trap. This is a check of that local example, not a complete accessibility audit.

No Formspree account, external notification inbox or real spam campaign was tested. These results explain the filtering mechanism; they do not establish a provider’s delivery rate or predict a reduction on your site.

If a honeypot is not enough

Review what still gets through before adding friction for everyone. A person submitting unwanted messages and a simple script filling every field are different problems.

If your receiver supports a challenge integration, follow that provider’s setup. For a custom Cloudflare Turnstile integration, the official documentation requires server-side token validation. Merely displaying the widget does not protect the receiving endpoint.

Keep the private verification key on the server. Ask your assistant to show how the receiver handles a failed verification and how a genuine visitor retries. If the hosting setup has no suitable receiver, stop and establish the supported integration rather than inventing a front-end-only check.

Changing several controls together makes failures harder to diagnose. Start with one supported change and keep your baseline enquiry for comparison.

Publish, then check the real form

After reviewing the diff and existing project checks, publish the small repair. Repeat the normal enquiry at the real domain and compare the actual receiver record and intended inbox.

Your completion note should say:

  • Which form and receiver changed.
  • Which filtering control was enabled.
  • Whether a genuine enquiry still arrived.
  • What filtering behaviour was observed.
  • What could not be verified and how to restore the previous version.

Do not claim “spam solved” after a single test. Keep enough non-sensitive evidence to compare later unwanted submissions and false positives. The useful outcome is a working enquiry route with a documented filtering change.

Sources and testing limits

Official documentation checked November 24, 2026:

Our local demonstration used fictional inputs and sent no email. It supports the stated local observations only; your provider, notifications and live visitors require their own checks.

Questions & answers

Will a hidden field stop every spam submission?

No. A bot can leave the field empty, and a person can submit unwanted messages. Treat a honeypot as one filtering layer, then check whether genuine enquiries still arrive.

Do I need to change hosting or buy a plugin?

Start with the form receiver you already use. Formspree documents its _gotcha honeypot on all plans. Other receivers have their own controls; a field name copied from another service may do nothing.

Does a thank-you message prove a submission was delivered?

No. Compare the submission with the receiver's records and the intended inbox. Some filtering deliberately gives an ordinary acknowledgement while ignoring the submission.