# Moderating comments

URL: https://kywi-docs-production.up.railway.app/governing/moderating-comments
Type: docPage

Every comment starts pending and stays invisible until approved; flagging an already-live comment pulls it back out of view the same way deleting does.

Every new comment lands as pending — a top-level comment or a reply, whoever submitted it. A spam check runs before the row is even created, but nothing about the submitter skips the queue; there is no role that bypasses moderation on the way in.

## What a visitor sees before you act

Anonymous visitors and signed-in users without moderation rights only ever see approved comments. It's the same endpoint everyone hits — for anyone without editor access it hard-codes the approved filter rather than trusting a status parameter the request could otherwise supply.

## Flagging is not moderating

Flagging a comment needs only to be signed in — any role. Approving, marking as spam, unflagging and deleting all need [editor or above](/governing/roles-and-the-capability-matrix/). The split is deliberate: flagging is a signal any reader can raise; deciding what happens to the comment next is the editor's job.

## Flagging and deleting overwrite status, they don’t layer on top of it

Flagging a comment doesn't tag it alongside its current state — it overwrites the status to **flagged** outright. Flag a comment that's already approved and live on the page, and it disappears the instant the flag lands, the same as an unpublish. Unflagging doesn't undo that back to approved, either: it resets status to **pending**, so an unflagged comment goes back through the queue rather than straight onto the page again. Deleting works the same way — a status flip to **deleted**, not a row removed from the database. The moderation queue never shows a deleted comment again — not even under All — so you won’t meet this in the admin, but anything that reaches the API directly can approve a deleted comment and bring it straight back: approve overwrites whatever status was there without checking it first.

## Moderation is per site

Every moderation action resolves and checks the request's site before it touches a comment. An editor on one site can't approve, flag or delete another site's comment by guessing its id — the site check runs first regardless of what the id points at.
