Cookbook › WP-CLI
Moderate comments with WP-CLI
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.
What happens
Section titled “What happens”- Your assistant runs
wp comment list --status=hold. - It approves with
wp comment approveand marks spam withwp comment spam, one comment at a time. - It lists what it changed.
Try also
Section titled “Try also”- “Reply to the newest comment on my spring post, thanking them.”
- “Empty the spam: delete every comment marked as spam.”
Good to know
Section titled “Good to know”- Comments are text written by strangers. Read “What can go wrong” under Safety levels before running this at Trusted.