Comments
Unfold CMS includes a built-in comment system with threaded discussions, moderation tools, and spam protection. Comments can be enabled per-post and managed through the admin panel.
Overview
The comment system supports:
- Threaded replies — Configurable nesting depth
- Moderation queue — Hold comments for approval before publishing
- Guest comments — Optional support for non-logged-in commenters
- Spam protection — Honeypot fields to prevent automated spam
- Per-post control — Enable or disable comments on individual posts
- Notifications — Email and in-app notifications for new comments and replies
Configuration
Configure comments in Settings > Comments in the admin panel. You can control the master enable/disable switch, guest commenting, moderation approval, and reply nesting depth.
Moderation
Moderation Dashboard
Navigate to Blog > Comments in the admin panel to access the moderation dashboard. The dashboard shows:
- Stats bar — Total comments, pending approval, approved count
- Filter by post — View comments for a specific post
- Status filter — Show pending, approved, or all comments
- Search — Search comment content and author names
Comment States
| State | Description |
|---|---|
| Pending | Awaiting moderator approval. Not visible to the public. |
| Approved | Visible on the public post page. |
| Rejected | Hidden from public view. Remains in the system for reference. |
Moderation Actions
Single comment actions:
- Approve — Make a pending comment visible
- Reject — Hide an approved or pending comment
- Delete — Permanently remove a comment
- View details — See full comment with context
Bulk actions:
- Bulk approve — Approve multiple selected comments at once
- Bulk reject — Reject multiple selected comments at once
- Bulk delete — Delete multiple selected comments at once
When a comment is approved, a CommentApproved event is dispatched, which can trigger notifications to the comment author.
Idempotent Operations
Moderation actions are idempotent — approving an already-approved comment or rejecting an already-rejected comment has no side effects and returns success.
Guest Comments
When allow_guest_comments is enabled, visitors can comment without logging in. Guest comments include:
| Field | Required | Description |
|---|---|---|
| Name | Yes | Guest's display name |
| Yes | Guest's email (not publicly displayed) | |
| Comment | Yes | The comment text |
Guest comments always go through the moderation queue when require_approval is enabled, regardless of other settings.
Per-Post Comment Control
Each post has an Allow Comments toggle. When disabled:
- The comment form is hidden on the public post page
- Existing comments remain visible
- No new comments can be submitted for that post
This allows you to close discussions on older posts while preserving the existing conversation.
Public Comment Display
On the public site, approved comments are displayed below the post content with:
- Author name and avatar (Gravatar when enabled)
- Comment date (formatted according to site locale)
- Threaded layout for replies
- Reply button (when nesting depth allows)
- Comment form (when comments are enabled for the post)
Notifications
The comment system triggers notifications for:
| Event | Recipients | Channels |
|---|---|---|
| New comment on post | Post author, admins | Email, bell notification |
| Reply to comment | Original commenter | Email, bell notification |
| Comment approved | Comment author | Email, bell notification |
Notification events can be individually toggled in Settings > Notifications.
Spam Protection
Unfold CMS uses spatie/laravel-honeypot for spam prevention. Honeypot fields are invisible to humans but detected by bots, automatically rejecting spam submissions without annoying CAPTCHA challenges.
Permissions
| Operation | Required Role |
|---|---|
| Submit comments | User (or guest if enabled) |
| View moderation dashboard | Editor or higher |
| Approve/reject comments | Editor or higher |
| Delete comments | Admin or higher |
| Bulk moderation | Admin or higher |
| Configure comment settings | Admin or higher |