
A custom field plugin for Strapi that automatically generates URL-friendly slugs from selected text field in your content types.
released April 19, 2026
npm install strapi-auto-slugA custom field plugin for Strapi v5 that automatically generates URL-friendly slugs from any text field in your content types.
-1, -2, etc. to ensure uniquenessnpm install strapi-auto-slugAdd the plugin to your config/plugins.js (or config/plugins.ts):
module.exports = {
'auto-slug': {
enabled: true,
},
};Rebuild your admin panel:
npm run buildWhen creating content, the slug field will automatically populate as you type in the source field.
Each auto-slug field can be configured with the following options in the Advanced settings tab:
| Setting | Default | Description |
|---|---|---|
| Auto-generate slug on creation | Enabled | Generate the slug from the source field when creating a new entry |
| Stop auto-generation after manual edit | Enabled | Stop syncing with the source field once the user manually edits the slug |
| Preserve slug when editing | Enabled | Keep the existing slug when editing an entry, even if the source field changes |
| Auto-generate for empty slugs on existing entries | Enabled | Treat existing entries with an empty slug the same as new entries |
| Required field | Disabled | Prevent saving if the slug field is empty |
When entries are created or updated via the REST or GraphQL API (without the admin panel):
The slugify algorithm:
café → cafe)Examples:
| Input | Slug |
|---|---|
Hello World | hello-world |
My Blog Post! | my-blog-post |
Café & Résumé | cafe-resume |
--Leading & Trailing-- | leading-trailing |
Multiple Spaces | multiple-spaces |
MIT
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
