Skip to content

Cookbook › WP-CLI

Moderate comments with WP-CLI

WP-CLI2 minutesChangesTested 15 Oct 2026
Paste into ChatGPT or ClaudeUse WP-CLI to list comments waiting for moderation. Approve the genuine ones and mark obvious spam as spam. Show me what you did.

Changes your site. Standard asks you first in wp-admin; Trusted does it directly.

  1. Your assistant runs wp comment list --status=hold.
  2. It approves with wp comment approve and marks spam with wp comment spam, one comment at a time.
  3. It lists what it changed.
  • “Reply to the newest comment on my spring post, thanking them.”
  • “Empty the spam: delete every comment marked as spam.”
  • Comments are text written by strangers. Read “What can go wrong” under Safety levels before running this at Trusted.