Article comments, visibility, and administration

Attach a comment thread to an article and understand posting, access, hiding, and deletion.

The same article shares a comment thread across locales. A public comment becomes visible as soon as it passes validation. Hide or delete it to remove it from public view. Pending, useful, and spam are management marks. Sites that require approval before every comment appears should evaluate that requirement separately.

Add comments to a theme

Pass the current entry ID to the component in an article detail template. Pass the page’s preview state when rendering a preview.

---
import CommentThread from "@platform/theme/comment/comment.astro";
---
<CommentThread targetType="cms.entry" targetId={payload.entry.id} preview={payload.preview === true} />

A thread can also target the site (cms.site). The target type and ID identify the thread. Service decides whether visitors may read and post based on target visibility and comment policy. The theme loads comments independently, so a new comment can appear without rebuilding article HTML.

How Admin actions affect readers

Change Visitor result
Global, target-type, or thread policy Threads inherit identity, posting, reply, and editing rules. Turning off posting still allows reading
Hide a comment The body disappears from public results and the reply relationship remains. An administrator can restore it
Delete a comment Its body and display name are cleared. A placeholder preserves the reply relationship
Hide the thread or withdraw the article Visitors lose public access to the thread or comments on the hidden article

Manage records at /comment and configure policy at /comment/settings. Anonymous posting uses a slider ticket and quota. Guests and members use their respective sessions.

Handle API results in a custom UI

Use GET /_/public/comment/thread and GET /_/public/comment/list for public reads and POST /_/public/comment/create for anonymous posting. A custom interface can follow packages/platform/theme/comment/session.ts. Resending the same content with the same requestId returns the existing comment without reusing a verification ticket or quota. An edited submission uses a new request.

The tested cases cover private entries, inherited policy, hidden text, resending a request, and preview action restrictions. See page rendering for how public data reaches the theme.