Formify Docs

Honeypot

The honeypotPlugin — a hidden anti-spam field

Honeypot

honeypotPlugin adds an anti-spam trap: a hidden field humans never fill. When it has a value, submission is silently blocked.

Usage

import { honeypotPlugin } from "formify-js";

plugins: [honeypotPlugin({ fieldName: "_hp" })] // default field name: "_hp"

// Render the trap somewhere invisible:
<div style={{ position: "absolute", left: "-9999px" }} aria-hidden>
  <Field name="_hp" tabIndex={-1} autoComplete="off" />
</div>

Options

OptionTypeDefaultDescription
fieldNamestring"_hp"The hidden field's name.

Things to know

  • Bots that fill every field trip the trap; legitimate users never touch it.
  • The field must be rendered (invisible) for the trap to work — see the example above.

On this page