Triage pending WordPress comments and clear out obvious spam
Every 3 hours, the agent reads comments awaiting moderation, has the AI classify them and only moves to spam the ones it is very sure about; the rest wait for you with a reason and, for questions, a suggested reply.
- Difficulty
- Intermediate
- Setup time
- ≈ 1 h (estimate)
- Estimated cost
- n8n: €0 self-hosted or from €20/month (Starter, billed annually) + OpenAI API calls
- Category
- Marketing
⏱ Trigger
Every 3 hours (cron) or on demand
✋ Human approval
Start in dry-run mode. After that, only very likely spam is moved, and it can be restored from WordPress's Spam tab: nothing is deleted or published automatically.
→ Output
Obvious spam cleared + remaining comments annotated (category, reason, suggested reply)
Autonomy level 3 — Autonomous: Runs end to end on its own; only low-risk actions (read, notify, archive).
01Connected tools
- n8n – Schedule Trigger ↗
- WordPress REST API – comments ↗
- WordPress – application passwords ↗
- n8n – HTTP Request ↗
- OpenAI API – pricing ↗
02What the agent does on its own
- step 01
Fetches comments on hold through the WordPress REST API (maximum per run is configurable).
- step 02
Cleans up and trims each comment before analysis.
- step 03
Has OpenAI classify each comment as spam, abusive, question, positive or other, with a confidence score, a reason and a suggested reply for questions.
- step 04
Marks as spam only the comments classified as spam above your confidence threshold; in dry-run mode it reports what it would have done without changing anything.
- step 05
Leaves everything else in the moderation queue; classification and suggested reply show up in the n8n execution history.
03Agent instructions
> You moderate comments on {SITE} ({TOPIC}). Comment from {AUTHOR}: "{TEXT}". Return JSON {"category":"spam|abusive|question|positive|other","confidence":0-1,"reason":"one sentence","suggested_reply":"… or empty"}. Honest criticism is not spam. Only suggest a reply for a question.04Limits and legal points
You need a WordPress application password: create it on an account that can moderate (an Editor, for instance) rather than an administrator. False positives can still happen: keep the threshold high and glance at the Spam tab now and then. Suggested replies are neither published nor sent: add an email or Slack step yourself to receive them. Comment text is sent to OpenAI.
05In short
- When does the agent run, and what does it produce?
- Trigger: Every 3 hours (cron) or on demand. Output: Obvious spam cleared + remaining comments annotated (category, reason, suggested reply).
- What stays under your control?
- Start in dry-run mode. After that, only very likely spam is moved, and it can be restored from WordPress's Spam tab: nothing is deleted or published automatically. Autonomy level 3 — Autonomous: Runs end to end on its own; only low-risk actions (read, notify, archive).
- How much does it cost and how long does setup take?
- Estimated cost: n8n: €0 self-hosted or from €20/month (Starter, billed annually) + OpenAI API calls. Setup time: ≈ 1 h (estimate), difficulty "intermediate". Tools: n8n – Schedule Trigger, WordPress REST API – comments, WordPress – application passwords, n8n – HTTP Request, OpenAI API – pricing.
Answers taken from this recipe · updated 22 October 2026
06Source
07Related recipes
Same category or same connected tools.