Classify migration guide

Migrate from Akismet to Botpoison Classify

Three edits: swap the API key, point the same form-encoded request at Classify, and read a JSON label instead of a "true" or "false" body. Your handler keeps its routes, its fields and its inbox.

Last verified

Migrate this project's spam filtering from Akismet to Botpoison Classify.
Follow the guide at https://botpoison.com/migrate/from-akismet.md
Make the three edits it describes, and keep the form's fields and routes.

Why sites move off Akismet

Akismet's free Personal plan is for personal sites. A business or commercial site needs a paid plan.

comment-check answers in plain text: true for spam, false for not, and anything else is an error that still arrives with status 200. There is no score, so there is nothing to hold a borderline message on.

Akismet grew up on blog comments, and its parameters still say so: blog, comment_author, comment_content. Classify takes the form as it arrived, whatever its fields are called.

What maps to what

Key
Akismetapi_key in the body
ClassifyA secret key, as a bearer token, an X-Api-Key header or secretKey
Endpoint
AkismetPOST to /1.1/comment-check on rest.akismet.com, form-encoded
ClassifyPOST to /classify on api.botpoison.com, form-encoded, as now; JSON also works
What you send
Akismetuser_ip, comment_author, comment_author_email, comment_content and more
ClassifyThe same form fields, without user_ip, blog or comment_type
Answer
Akismettrue or false as text, and a pro-tip header for blatant spam
Classifylabel, spam or clean, a score from 0 to 1, and the model
Errors
AkismetStatus 200, with some other text in the body
ClassifyA 4xx or 5xx status, with a JSON message

The three edits. Off Akismet, onto Classify

Swap the key

Replace the Akismet API key with your project's secret key, kept in your server's environment like the old one.

Shell
AKISMET_KEY=xxxxxxxx
BOTPOISON_SECRET_KEY=sk_xxxxxxxx

Point the request at Classify

Keep the form-encoded request and its comment fields. Swap the URL and the key, name the model in _model, and drop blog, user_ip and comment_type.

JavaScript
const akismet = await fetch("https://rest.akismet.com/1.1/comment-check", {
const classify = await fetch("https://api.botpoison.com/classify", {
method: "POST",
body: new URLSearchParams({
api_key: process.env.AKISMET_KEY,
blog: "https://example.com",
user_ip: req.ip,
comment_type: "contact-form",
secretKey: process.env.BOTPOISON_SECRET_KEY,
_model: "spam-standard",
comment_author: req.body.name,
comment_author_email: req.body.email,
comment_content: req.body.message,
}),
});

Read the label instead of the text body

Akismet answers "true" for spam in the response body. Classify answers JSON, with spam or clean as the label.

JavaScript
const isSpam = (await akismet.text()) === "true";
const isSpam = (await classify.json()).label === "spam";
if (isSpam) return fileAway(req.body);

What behaves differently

A score instead of a hint. Akismet's X-akismet-pro-tip: discard marks the blatant cases. Classify's score does that job with a number you can start a review queue from.

An outage answers 503. It is not counted. Deliver the message as clean, so an outage never loses a real one.

Questions

Is there a WordPress plugin?

No. Classify is an API, so it fits wherever your own code handles the submission: a form handler, a comment route, a signup.

Is there a test value, like akismet-guaranteed-spam?

Yes. With the secret key test, a message containing botpoison-test-spam answers spam and anything else answers clean. Test calls never count. See test mode.

Moving from OOPSpam instead?

See the guide from OOPSpam.

Sources

Akismet is a trademark of Automattic. Botpoison is not affiliated with Automattic.

Other migration guides

To Challenge

Invisible CAPTCHA alternative
  • v2 checkbox, v2 invisible or v3 score. Swap the script, the key and the siteverify call.

  • Drop the cf-turnstile widget. The check runs fresh on each Send and moves to one verify call.

  • Remove the h-captcha div and the form-encoded siteverify request. Nobody labels images again.

To Classify

Spam classifier
  • A score from 0 to 6 against your threshold becomes a label, with the score kept for a review queue.

Switch to Classify for free

Stop spam now
No credit card required
Three edits
Your fields stay as they are
Free to start