Auto Slug Manager
Universal auto slug generator for all Strapi v5 content types with full Rich Text support. Automatically generates SEO-friendly slugs from title fields with Cyrillic transliteration, uniqueness checking, and beautiful admin interface.
Strapi Plugin: Auto Slug Manager
🔗 Universal auto slug generator for all Strapi v5 content types with full Rich Text support
✨ Features
- 🚀 Universal: Works with ANY content type that has a
slug
field - 🔍 Auto-discovery: Automatically finds and processes all content types with slug fields
- 📝 Rich Text Support: Handles both new Blocks editor and classic Rich Text (HTML)
- 🌐 Cyrillic Support: Perfect transliteration for Russian and other Cyrillic languages
- ⚙️ Highly Configurable: Flexible field selection and behavior customization
- 🎨 Beautiful Admin UI: Modern, intuitive settings panel
- 🔄 Smart Updates: Option to update existing slugs or preserve them
- 🎯 Unique Slugs: Automatic suffix generation for duplicates (-1, -2, -3...)
🎯 Compatibility
Environment | Version | Status |
---|---|---|
Strapi | v5.0.0+ | ✅ Fully Supported |
Node.js | 18.x, 20.x, 22.x | ✅ Tested |
NPM | 8.x+ | ✅ Compatible |
Yarn | 1.x, 3.x+ | ✅ Compatible |
Strapi Version Support
- ✅ Strapi v5.0.0+: Full support with all features
- ❌ Strapi v4.x: Not compatible (use legacy lifecycle approach)
- ❌ Strapi v3.x: Not compatible
Database Support
The plugin works with all Strapi-supported databases:
- ✅ PostgreSQL (Recommended)
- ✅ MySQL/MariaDB
- ✅ SQLite (Development only)
Rich Text Editor Support
- ✅ Blocks Editor (Strapi v5 default) - Full support
- ✅ Classic Rich Text (HTML) - Full support
- ✅ Markdown fields - Treated as string
Browser Compatibility (Admin Panel)
- ✅ Chrome 90+
- ✅ Firefox 88+
- ✅ Safari 14+
- ✅ Edge 90+
📦 Installation
npm install strapi-plugin-auto-slug-manager-a-mi13
# or
yarn add strapi-plugin-auto-slug-manager-a-mi13
🛠️ Setup
- Add to plugins configuration (
config/plugins.js
):
1module.exports = {
2 'auto-slug-manager': {
3 enabled: true,
4 },
5};
- Restart your Strapi application:
npm run develop
# or
yarn develop
- Configure via Admin Panel: Navigate to Settings → Auto Slug Manager
🎯 Usage
Automatic Operation
The plugin automatically generates slugs for any content type with a slug
field:
1// Creating content
2const article = await strapi.entityService.create('api::article.article', {
3 data: {
4 title: 'My Amazing Article',
5 // slug will be automatically generated as 'my-amazing-article'
6 }
7});
Rich Text Support
The plugin intelligently handles different field types:
1. Regular String Fields:
1title: "Hello World" → slug: "hello-world"
2. Rich Text Blocks (New Editor):
1title: [
2 {
3 type: "paragraph",
4 children: [{ type: "text", text: "Hello World" }]
5 }
6] → slug: "hello-world"
3. Classic Rich Text (HTML):
1title: "<h1>Hello World</h1><p>Description</p>" → slug: "hello-world-description"
Cyrillic Transliteration
Perfect for Russian content:
1title: "Моя статья" → slug: "moya-statya"
2title: "Тестовая статья для слуг" → slug: "testovaya-statya-dlya-slug"
⚙️ Configuration
Admin Panel Settings
Access via Settings → Auto Slug Manager:
Setting | Description | Default |
---|---|---|
Enable Plugin | Turn on/off automatic slug generation | true |
Source Field | Primary field to generate slug from | title |
Fallback Field | Backup field if source is empty | name |
Process Rich Text | Extract text from Rich Text fields | true |
Update Existing Slugs | Update slug when source changes | true |
Cyrillic Support | Transliterate Cyrillic to Latin | true |
Available Source Fields
title
- Most common choicename
- Alternative naming fieldlabel
- Label or display nameheading
- Header or title fieldcaption
- Caption or subtitle
Programmatic Configuration
You can also configure via config/plugins.js
:
1module.exports = {
2 'auto-slug-manager': {
3 enabled: true,
4 config: {
5 enabled: true,
6 sourceField: 'title',
7 fallbackField: 'name',
8 handleRichText: true,
9 updateExistingSlugs: true,
10 supportCyrillic: true,
11 slugifyOptions: {
12 lower: true,
13 strict: true,
14 locale: 'ru'
15 }
16 }
17 },
18};
🔧 Advanced Usage
Custom Slug Generation
The plugin provides hooks for custom logic:
1// In your content type lifecycle (optional)
2module.exports = {
3 async beforeCreate(event) {
4 // Plugin handles this automatically
5 // You can add custom logic here if needed
6 }
7};
Content Type Requirements
For the plugin to work, your content type must have a slug
field:
1// In your content type schema
2{
3 "attributes": {
4 "title": {
5 "type": "string"
6 },
7 "slug": {
8 "type": "uid",
9 "targetField": "title" // Optional: Strapi admin reference
10 }
11 }
12}
🎨 Admin Interface
The plugin includes a beautiful, modern admin interface:
- Toggle switches for all boolean settings
- Dropdown selectors for field configuration
- Real-time status showing discovered content types
- Save functionality with success/error feedback
🔍 Troubleshooting
Plugin Not Working?
- Check console logs for error messages
- Verify slug field exists in your content type
- Restart Strapi after configuration changes
- Check admin panel for plugin status
Common Issues
Slugs not generating:
- Ensure your content type has a
slug
field - Check that the source field contains text
- Verify plugin is enabled in settings
Cyrillic not transliterating:
- Enable "Cyrillic Support" in settings
- Check
slugifyOptions.locale
is set to 'ru'
Duplicates not handled:
- Plugin automatically adds suffixes (-1, -2, -3...)
- Check database for existing slugs
🧪 Testing
The plugin includes comprehensive test examples:
1// Test cases covered:
2✅ String field extraction
3✅ Rich Text Blocks processing
4✅ Classic Rich Text (HTML) processing
5✅ Cyrillic transliteration
6✅ Unique slug generation
7✅ Update vs. preserve existing slugs
8✅ Fallback field usage
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built for Strapi v5.x
- Uses slugify for text processing
- Designed for production environments
📞 Support
- 🐛 Bug Reports: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Email: alex-c13@mail.ru
Made with ❤️ for the Strapi community
Install now
npm install strapi-plugin-auto-slug-manager-a-mi13
Create your own plugin
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.