Janitor
Finds orphaned uploads and unreferenced documents in Payload storage, then deletes only the entries you approve.
Installation
pnpm add @seshuk/payload-plugin-janitor About
Janitor scans a Payload project for files and documents that nothing points to anymore: upload objects left in the bucket after their document was removed, broken uploads, and records no other document references. It writes each candidate to a findings collection, so a person reviews the list in the admin before anything is removed. Deletion only touches findings marked as approved. The plugin adds two collections to the config, one for findings and one for scan runs, and wraps your existing upload collections so it can track which files they reference. A scheduled job task runs scans through Payload's jobs queue, and a dashboard widget and a field highlight component show the current state in the admin panel. Scans can also be started from code with `runJanitor` or `startJanitor`, and `purgeApproved` removes what has been signed off. Storage access goes through adapters. Separate entry points cover S3, Cloudflare R2, Bunny, Azure Blob, Google Cloud Storage, UploadThing, Vercel Blob and local disk, and the S3 adapter needs `@aws-sdk/client-s3` installed. The plugin can be turned off with `enabled: false`, which keeps the collections and translations but skips the admin and job hooks. The package is at version 1.0.0-beta.1, so option names and behaviour may still change before a stable release.
Package info
- Package name
@seshuk/payload-plugin-janitor- Latest version
0.1.0- Unpacked size
- 1.6 MB
- License
- MIT
- Last publish
- Oct 14, 2026
More from maximseshuk
View profileSitemap
Builds sitemap.xml files from Payload collections and static URLs, then stores them in any Payload storage adapter.
Shared plugin tooling
Dev-only shared config for lint, format, TypeScript, build, test database, and release workflows across the @seshuk Payload plugins.
OpenAPI
Generates OpenAPI specifications from Payload CMS configurations.
Bunny Storage Adapter
Bunny.net storage and stream adapter for Payload CMS with TUS resumable uploads and CDN cache purging.
Media Preview
Preview images, videos, audio, and documents directly in the Payload CMS admin panel.
Similar plugins
More in StorageUpstash KV adapter
Integrates Upstash as a key-value storage solution for Payload.
Cloudinary storage adapter
Integrates Cloudinary storage into Payload CMS for media management.
ISR revalidation
Integrates ISR-style cache revalidation into Payload CMS for Next.js.
Cloud Storage
This plugin integrates cloud storage options into Payload CMS.
Nextcloud
Nextcloud storage adapter for Payload CMS that uploads files over WebDAV and optionally creates public share links via the Nextcloud OCS API.