slug redirects
Automatically creates slug redirects when document slugs change.
Installation
pnpm add payload-slug-redirects About
This plugin for PayloadCMS tracks changes to document slugs and automatically generates corresponding redirects. When a slug is renamed, it records the change using an `afterChange` hook, allowing old URLs to redirect to the new document slug when accessed. The plugin supports chained renames, ensuring that multiple updates to a slug point to the most current URL. Users can configure the plugin to watch specific collections and localizations. It injects a slug field when necessary and handles multi-locale compatibility with ease. On the frontend, the plugin provides a `SlugRedirect` component for Next.js apps to manage client-side redirects efficiently, querying the `slug-redirects` collection to ensure visitors are directed to the correct content even after slugs have changed. Additional options include revalidation endpoints for static site generation and configuring visibility settings for the management interface within Payload CMS. The plugin simplifies the handling of slug changes, making it a valuable tool for content-heavy applications.
Package info
- Package name
payload-slug-redirects- Latest version
2.0.0- Unpacked size
- 55 kB
- License
- MIT
- Weekly downloads
- 14
- Last publish
- Mar 20, 2026
Similar plugins
More in SEOSEO Analyzer
Payload plugin that audits page SEO in the editor sidebar with 50+ checks, a dashboard, score history, redirects and IndexNow.
Llms Txt
Generates llms.txt and llms-full.txt files for LLMs from your Payload collections.
SEO plugin
A plugin to manage SEO metadata from within the Payload admin panel.
PageSpeed Insights
Integrates Google PageSpeed Insights into Payload CMS for performance analysis.