Auto-hide spam comments on a Facebook Page with AI
To auto-hide spam comments on a Facebook Page with AI, send each new comment to a model that sorts it, for example as spam, abuse or fine, and hide the bad ones through Meta's API, which marks them is_hidden. A hidden comment is not deleted and can be shown again. easyCoexistence does it with an automation: a comment trigger, an AI picks the path step, then Hide the comment.
The comment field a Page sets to hide a comment or show it again; Meta marks it as applying to Page comments.
Meta's Page feed webhook sends no events for ad posts themselves, but does send them for comments on ad posts.
How many paths one AI picks the path step holds in easyCoexistence, plus an Otherwise line for when none fits.
Comment-to-DM rules answer before automations, so a comment a rule answers never reaches a hiding automation.
How long easyCoexistence keeps new comments and inbound events, and an automation's run logs.
How does AI comment moderation work on a Facebook Page?
In three moves, while you are away. Meta's feed webhook reports new comments on the Page's posts as they arrive. The automation sends the comment to your model with a one-sentence description of each path, and the model names the path that fits. The path you made for spam hides the comment through the Graph API by setting is_hidden on it; the other paths do nothing, or reply.
How do you build it in easyCoexistence?
In the Automations tab, with one automation on the Page:
- Trigger: Someone comments on a post, with no keyword filter (match any), on Any post, so the AI reads the comments as they arrive.
- Step: AI picks the path, with your provider and model, and two paths, such as Spam and Abuse, each described in one sentence.
- Inside each of those paths: Hide the comment, plus Notify me if you want an email, at most 20 an hour per automation.
- Otherwise: leave it empty, or add Reply to the comment for a public thank-you.
What should the paths say?
One plain sentence per path, written as a rule a new moderator could follow. Your model reads the comment alone, without the post or earlier comments, so put what it needs to know in Extra instructions (optional). For example:
- Spam: "Ads for other businesses, follower or crypto offers, and links to sites that are not ours."
- Abuse: "Insults, threats or hate aimed at people, not complaints about our service."
- Extra instructions: "Questions about prices, delivery or stock are never spam, even with a link to our own site, ourshop.com."
- Leave honest complaints visible and answer them; hide only what breaks your rules.
Keywords or AI: which should hide a comment?
Both, each in its place. Only one automation handles each comment, and a keyword match goes before the catch-all, so a keyword automation can hide the obvious spam with no AI call while the AI automation judges the rest. Facebook's own keyword blocking also hides comments with words you choose, inside Facebook.
| Has keyword | AI picks the path | |
|---|---|---|
| Catches | Words you list, anywhere, at the start or as the whole comment | What the comment means, in any language |
| Misses | New spellings and new phrasing | Now and then, a comment it reads wrong |
| Cost | No AI call | One short call on your own key per comment |
| Setup | A list of words | A sentence per path, then tests |
What happens to a hidden comment?
It stays on Facebook, hidden, until someone shows it again. Meta's is_hidden field applies to Page comments, and setting it back to false brings a comment back, which hide_comment does with hide set to false when you ask Claude or ChatGPT. To remove a comment for good, delete it on Facebook or in Meta Business Suite. The automation's Runs tab lists each comment it acted on, with the path the AI picked, for 30 days.
Can Claude or ChatGPT set it up for you?
Yes. Describe what to hide in plain words, and the assistant calls create_automation on the Page, then test_automation with a spam sample and a normal comment. A test runs your model for real but hides nothing, and its log shows which path each sample took. AI keys are added in the dashboard, never in the chat.
You: On our Facebook Page, hide comments that are spam or abuse.
Questions about our products are never spam.
→ create_automation {
"connection_id": "…the Page's channel_id, from list_social_accounts…",
"name": "Hide spam comments",
"trigger": { "type": "comment_received", "match": "any" },
"steps": [{
"type": "ai_decide",
"provider": "openai",
"model": "…",
"instructions": "Questions about our products are never spam.",
"paths": [
{ "name": "Spam", "description": "Ads, follower offers or links to other sites",
"steps": [{ "type": "hide_comment" }] },
{ "name": "Abuse", "description": "Insults, threats or hate aimed at people",
"steps": [{ "type": "hide_comment" }] }
],
"otherwise": []
}]
}
→ test_automation { "automation_id": "…", "text": "Cheap followers here bit.ly/x" }What does it cost, and what is kept?
Each comment costs one short call to your model, billed by your AI provider to your own Anthropic, OpenAI or OpenRouter key. easyCoexistence charges per connection, not per comment, from US$ 9 down to US$ 0.75 per connection per month as you add connections. With an automation on, it keeps new comments and inbound events for 7 days and run logs for 30 days.
What about comments already on your posts?
The automation only sees comments that arrive after it is switched on. For older ones, ask Claude or ChatGPT: list_social_comments reads up to 50 top-level comments of a post per call, and hide_comment hides the ones you approve. easyCoexistence does not delete comments, block people or report them; do that on Facebook.
How to set it up
- Add your AI keyIn Automations, open AI keys, pick Anthropic, OpenAI or OpenRouter, paste the key and click Test and save.
- Start the automationClick New automation, start from scratch, and pick the Page and the trigger Someone comments on a post, on Any post.
- Add AI picks the pathAdd the step AI picks the path, choose the model, and describe a Spam path and an Abuse path in one sentence each.
- Hide on those pathsInside the Spam and Abuse paths, add Hide the comment; leave Otherwise empty, or add Reply to the comment.
- Test, then switch it onSave it switched off, open Test and run a spam sample and a normal comment; nothing is hidden in a test. Then switch it on.
Common mistakes
- Hiding any comment that has a link. Your own site, a product page or a map link is not spam; say so in Extra instructions and test with real comments first.
- Adding a second automation for the same comments. Only one automation handles a comment, keyword matches first, so put hiding and replies in one flow with paths.
- Keeping a comment-to-DM rule with a broad keyword. Rules answer before automations, so a spam comment containing that keyword gets the DM and is never checked for hiding.
- Treating hidden as deleted. A hidden comment stays on Facebook and can be shown again; delete it on Facebook when it must go.
easyCoexistence hides spam on a Facebook Page as comments arrive: an automation sends new comments to your own Anthropic, OpenAI or OpenRouter model, hides the ones it marks as spam or abuse, and logs each decision. The same flow can answer the good comments, and Instagram and TikTok accounts take it too. US$ 9 to US$ 0.75 per connection per month, falling as you add connections, with the first 3 days free.
easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook, Google Business Profile and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.
Frequently asked questions
Does it work on comments under my ads?
Yes. Meta's feed webhook sends events for comments on the Page's ad posts, though not for the ad posts themselves, so an automation on Any post reads those comments like the rest.
Which AI model should I use?
A small, fast model from Anthropic, OpenAI or OpenRouter is usually enough, since the step only asks it to name one path. Test it on twenty real comments from your Page before you switch the automation on.
Can it hide comments written in other languages?
Yes. The model picks the path by meaning, in any language, so you can describe the paths in your own language and it still sorts comments written in others.
Can the same flow run on Instagram and TikTok?
Yes. Instagram and TikTok accounts take comment automations with AI picks the path and Hide the comment, each as its own automation on that account.
Keep reading
Connect your first channel in two minutes.
No platform reviews to wait for. Connect WhatsApp, Instagram, TikTok or another channel, then ask your AI to post, reply or report, and watch it work.
- 3 days free
- Cancel any time
- Official APIs only
- Monitored 24/7
Verified on