Adds a redirects collection to Payload so editors can manage URL redirects in the admin panel. Each redirect can point to a document in configured collections or to a custom URL, with optional redirect types such as 301 and 302. Your frontend queries the collection and applies the redirects, for example in Next.js middleware.
Redirects plugin for Payload
Installation
npm i @payloadcms/plugin-redirects46.1k
Stars
4.5k
Forks
1821
Open Issues
Today
Last Updated
200.1k
Weekly Downloads
v3.94.2
npm Version
37.1 KB
Unpacked Size
2
Dependencies
46.1K+1.8K since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 46,145 |
| Dec 5, 2026 | 46,136 |
| Dec 4, 2026 | 46,125 |
| Dec 3, 2026 | 46,106 |
| Dec 2, 2026 | 46,087 |
| Dec 1, 2026 | 46,068 |
| Nov 30, 2026 | 46,059 |
| Nov 29, 2026 | 46,037 |
| Nov 28, 2026 | 46,035 |
| Nov 27, 2026 | 46,022 |
| Nov 26, 2026 | 46,012 |
| Nov 25, 2026 | 45,993 |
| Nov 24, 2026 | 45,976 |
| Nov 23, 2026 | 45,958 |
| Nov 22, 2026 | 45,947 |
| Nov 21, 2026 | 45,937 |
| Nov 20, 2026 | 45,926 |
| Nov 19, 2026 | 45,901 |
| Nov 18, 2026 | 45,868 |
| Nov 17, 2026 | 45,852 |
| Nov 16, 2026 | 45,831 |
| Nov 15, 2026 | 45,820 |
| Nov 14, 2026 | 45,807 |
| Nov 13, 2026 | 45,792 |
| Nov 12, 2026 | 45,779 |
| Nov 11, 2026 | 45,763 |
| Nov 10, 2026 | 45,742 |
| Nov 9, 2026 | 45,731 |
| Nov 8, 2026 | 45,722 |
| Nov 7, 2026 | 45,704 |
| Nov 6, 2026 | 45,681 |
| Nov 5, 2026 | 45,670 |
| Nov 4, 2026 | 45,647 |
| Nov 3, 2026 | 45,629 |
| Nov 2, 2026 | 45,611 |
| Nov 1, 2026 | 45,603 |
| Oct 31, 2026 | 45,592 |
| Oct 30, 2026 | 45,574 |
| Oct 29, 2026 | 45,561 |
| Oct 28, 2026 | 45,543 |
| Oct 27, 2026 | 45,519 |
| Oct 26, 2026 | 45,492 |
| Oct 25, 2026 | 45,472 |
| Oct 24, 2026 | 45,449 |
| Oct 23, 2026 | 45,430 |
| Oct 22, 2026 | 45,405 |
| Oct 21, 2026 | 45,259 |
| Oct 20, 2026 | 45,239 |
| Oct 19, 2026 | 45,213 |
| Oct 18, 2026 | 45,192 |
| Oct 17, 2026 | 45,165 |
| Oct 16, 2026 | 45,148 |
| Oct 15, 2026 | 45,122 |
| Oct 14, 2026 | 45,100 |
| Oct 13, 2026 | 45,082 |
| Oct 12, 2026 | 45,057 |
| Oct 11, 2026 | 45,032 |
| Oct 10, 2026 | 45,023 |
| Oct 9, 2026 | 45,003 |
| Oct 8, 2026 | 44,983 |
| Oct 7, 2026 | 44,959 |
| Oct 6, 2026 | 44,935 |
| Oct 5, 2026 | 44,924 |
| Oct 4, 2026 | 44,907 |
| Oct 3, 2026 | 44,891 |
| Oct 2, 2026 | 44,876 |
| Oct 1, 2026 | 44,859 |
| Sep 30, 2026 | 44,846 |
| Sep 29, 2026 | 44,829 |
| Sep 28, 2026 | 44,805 |
| Sep 27, 2026 | 44,787 |
| Sep 26, 2026 | 44,769 |
| Sep 25, 2026 | 44,737 |
| Sep 24, 2026 | 44,709 |
| Sep 23, 2026 | 44,691 |
| Sep 22, 2026 | 44,669 |
| Sep 21, 2026 | 44,641 |
| Sep 20, 2026 | 44,628 |
| Sep 19, 2026 | 44,609 |
| Sep 18, 2026 | 44,595 |
| Sep 17, 2026 | 44,570 |
| Sep 16, 2026 | 44,548 |
| Sep 15, 2026 | 44,523 |
| Sep 14, 2026 | 44,501 |
| Sep 13, 2026 | 44,488 |
| Sep 12, 2026 | 44,470 |
| Sep 11, 2026 | 44,447 |
| Sep 10, 2026 | 44,427 |
| Sep 9, 2026 | 44,402 |
| Sep 8, 2026 | 44,384 |
| Sep 7, 2026 | 44,364 |
Shared by 12 plugins in payloadcms/payload.
196.8K+57.3K since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 196,819 |
| Dec 5, 2026 | 193,670 |
| Dec 4, 2026 | 189,650 |
| Dec 3, 2026 | 188,298 |
| Dec 2, 2026 | 190,498 |
| Dec 1, 2026 | 195,070 |
| Nov 30, 2026 | 198,768 |
| Nov 29, 2026 | 204,811 |
| Nov 28, 2026 | 212,928 |
| Nov 27, 2026 | 218,019 |
| Nov 26, 2026 | 222,737 |
| Nov 25, 2026 | 225,137 |
| Nov 24, 2026 | 223,736 |
| Nov 23, 2026 | 225,090 |
| Nov 22, 2026 | 222,560 |
| Nov 21, 2026 | 224,997 |
| Nov 20, 2026 | 227,035 |
| Nov 19, 2026 | 225,317 |
| Nov 18, 2026 | 223,317 |
| Nov 17, 2026 | 220,742 |
| Nov 16, 2026 | 219,952 |
| Nov 15, 2026 | 223,576 |
| Nov 14, 2026 | 224,782 |
| Nov 13, 2026 | 227,864 |
| Nov 12, 2026 | 224,573 |
| Nov 11, 2026 | 219,840 |
| Nov 10, 2026 | 220,824 |
| Nov 9, 2026 | 217,653 |
| Nov 8, 2026 | 217,243 |
| Nov 7, 2026 | 215,061 |
| Nov 6, 2026 | 211,315 |
| Nov 5, 2026 | 210,944 |
| Nov 4, 2026 | 215,294 |
| Nov 3, 2026 | 218,356 |
| Nov 2, 2026 | 224,693 |
| Nov 1, 2026 | 223,694 |
| Oct 31, 2026 | 223,720 |
| Oct 30, 2026 | 220,905 |
| Oct 29, 2026 | 184,890 |
| Oct 28, 2026 | 146,591 |
| Oct 27, 2026 | 147,817 |
| Oct 26, 2026 | 144,468 |
| Oct 25, 2026 | 144,570 |
| Oct 24, 2026 | 140,603 |
| Oct 23, 2026 | 105,506 |
| Oct 22, 2026 | 147,280 |
| Oct 21, 2026 | 180,921 |
| Oct 20, 2026 | 177,324 |
| Oct 19, 2026 | 174,766 |
| Oct 18, 2026 | 171,020 |
| Oct 17, 2026 | 171,937 |
| Oct 16, 2026 | 207,263 |
| Oct 15, 2026 | 202,433 |
| Oct 14, 2026 | 200,415 |
| Oct 13, 2026 | 195,931 |
| Oct 12, 2026 | 197,026 |
| Oct 11, 2026 | 196,497 |
| Oct 10, 2026 | 200,292 |
| Oct 9, 2026 | 200,662 |
| Oct 8, 2026 | 195,023 |
| Oct 7, 2026 | 196,087 |
| Oct 6, 2026 | 198,598 |
| Oct 5, 2026 | 196,339 |
| Oct 4, 2026 | 195,246 |
| Oct 3, 2026 | 189,168 |
| Oct 2, 2026 | 185,487 |
| Oct 1, 2026 | 186,904 |
| Sep 30, 2026 | 182,445 |
| Sep 29, 2026 | 178,064 |
| Sep 28, 2026 | 175,246 |
| Sep 27, 2026 | 167,897 |
| Sep 26, 2026 | 159,442 |
| Sep 25, 2026 | 154,852 |
| Sep 24, 2026 | 147,933 |
| Sep 23, 2026 | 145,173 |
| Sep 22, 2026 | 144,536 |
| Sep 21, 2026 | 144,190 |
| Sep 20, 2026 | 149,446 |
| Sep 19, 2026 | 151,726 |
| Sep 18, 2026 | 147,335 |
| Sep 17, 2026 | 145,779 |
| Sep 16, 2026 | 139,494 |
| Sep 15, 2026 | 140,595 |
| Sep 14, 2026 | 139,365 |
| Sep 13, 2026 | 132,135 |
| Sep 12, 2026 | 128,281 |
| Sep 11, 2026 | 129,921 |
| Sep 10, 2026 | 134,619 |
| Sep 9, 2026 | 140,390 |
| Sep 8, 2026 | 140,150 |
| Sep 7, 2026 | 139,483 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/official-plugin-redirects)<a href="https://payloaddirectory.dev/plugins/official-plugin-redirects"><img src="https://payloaddirectory.dev/badge/official-plugin-redirects.svg" alt="Payload Directory"></a>README
A plugin for Payload to easily manage your redirects from within your admin panel.
pnpm add @payloadcms/plugin-redirects
In your Payload Config, add the plugin:
import { buildConfig } from 'payload'
import { redirectsPlugin } from '@payloadcms/plugin-redirects'
export default buildConfig({
plugins: [
redirectsPlugin({
collections: ['pages'], // Collections to use in the 'to' relationship field
}),
],
})
| Option | Type | Description |
|---|---|---|
collections | string[] | An array of collection slugs to populate in the to field of each redirect. |
overrides | object | A partial collection config that allows you to override anything on the redirects collection. |
redirectTypes | string[] | Provide an array of redirects if you want to provide options for the type of redirects to be supported. |
redirectTypeFieldOverride | Field | A partial Field config that allows you to override the Redirect Type field if enabled above. |
import { buildConfig } from 'payload'
import { redirectsPlugin } from '@payloadcms/plugin-redirects'
export default buildConfig({
plugins: [
redirectsPlugin({
collections: ['pages', 'posts'],
// Add custom redirect types
redirectTypes: ['301', '302'],
// Override the redirects collection
overrides: {
slug: 'custom-redirects',
// Add custom fields
fields: ({ defaultFields }) => {
return [
...defaultFields,
{
name: 'notes',
type: 'textarea',
admin: {
description: 'Internal notes about this redirect',
},
},
]
},
},
}),
],
})
The plugin automatically includes translations for English, French, and Spanish. If you want to customize existing translations or add new languages, you can override them in your config:
import { buildConfig } from 'payload'
import { redirectsPlugin } from '@payloadcms/plugin-redirects'
export default buildConfig({
i18n: {
translations: {
// Add your custom language
de: {
'plugin-redirects': {
fromUrl: 'Von URL',
toUrlType: 'Ziel-URL-Typ',
internalLink: 'Interner Link',
customUrl: 'Benutzerdefinierte URL',
documentToRedirect: 'Dokument zum Weiterleiten',
redirectType: 'Weiterleitungstyp',
},
},
// Or override existing translations
fr: {
'plugin-redirects': {
fromUrl: 'URL source', // Custom override
},
},
},
},
plugins: [
redirectsPlugin({
collections: ['pages'],
}),
],
})
The plugin creates a redirects collection in your database. You can query this collection from your frontend and implement the redirects using your framework's routing system.
// middleware.ts
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
export async function middleware(request: NextRequest) {
const { pathname } = request.nextUrl
// Fetch redirects from Payload API
const redirects = await fetch('http://localhost:3000/api/redirects', {
next: { revalidate: 60 }, // Cache for 60 seconds
}).then((res) => res.json())
// Find matching redirect
const redirect = redirects.docs?.find((r: any) => r.from === pathname)
if (redirect) {
const destination =
redirect.to.type === 'reference'
? redirect.to.reference.slug // Adjust based on your collection structure
: redirect.to.url
return NextResponse.redirect(
new URL(destination, request.url),
redirect.type === '301' ? 301 : 302,
)
}
return NextResponse.next()
}
Topics
nested docs
Official plugin for nesting Payload documents inside one another
100151.9k/wk46.1kv3 v4
payload redirect
Automatic and manual 301/302 redirect rules stored in a native Payload collection, with cycle validation
793.4k/wk0v3
localized slugs
Copies localized slug and full path values into a per-locale localizedSlugs field for multi-language Payload sites
7881/wk9v3
redirects
Managed redirects collection with a cache-backed Next.js middleware matcher and pluggable cache adapters
64176/wk16v3
payload slug redirects
Records slug changes in Payload and redirects old URLs to the current slug in Next.js
6471/wk3v3
paths
Stored, queryable document paths for Payload page trees with publish-time uniqueness and a framework-agnostic resolver
60164/wk16v3