payload-discussions
Threaded comment discussions with nested replies and author tracking for Payload CMS.

Overview
Attach threaded discussions to any collection or global in Payload. Comments support nested replies, are linked to authenticated users, and are automatically cleaned up when parent documents are deleted or restored. A ready-made sidebar component integrates directly into the admin panel.
Features
- Threaded replies -- nested comment threads with configurable maximum depth.
- Sidebar UI -- a field component that renders discussions in the Payload admin sidebar.
- Lifecycle handling -- comments follow their parent document through soft-delete, permanent delete, and restore.
- Collection & global support -- attach discussions to any combination of collections and globals.
Installation
pnpm add payload-discussions
Usage
import { buildConfig } from "payload";
import { discussionsPlugin } from "payload-discussions";
export default buildConfig({
plugins: [
discussionsPlugin({
collections: ["posts", "pages"],
globals: ["settings"],
}),
],
});
Options
collections | CollectionSlug[] | [] | Collections to add the discussions field to. |
globals | GlobalSlug[] | [] | Globals to add the discussions field to. |
maxCommentDepth | number | 5 | Maximum nesting depth for reply threads. |
collectionSlug | string | "comments" | Slug used for the auto-created comments collection. |
Contributing
This plugin lives in the payload-plugins monorepo.
Development
pnpm install
pnpm --filter payload-discussions dev
pnpm --filter sandbox dev
The sandbox/ directory is a Next.js + Payload app that imports plugins via workspace:* — use it to test changes locally.
Code quality
- Formatting & linting — handled by Biome, enforced on commit via husky + lint-staged.
- Commits — must follow Conventional Commits with a valid scope (e.g.
fix(payload-discussions): ...).
- Changesets — please include a changeset in your PR by running
pnpm release.
Issues & PRs
Bug reports and feature requests are welcome — open an issue.
License
MIT