Strapi plugin logo for Auto Slug Manager

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

npm version License: MIT

✨ 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

EnvironmentVersionStatus
Strapiv5.0.0+✅ Fully Supported
Node.js18.x, 20.x, 22.x✅ Tested
NPM8.x+✅ Compatible
Yarn1.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

  1. Add to plugins configuration (config/plugins.js):
1module.exports = {
2  'auto-slug-manager': {
3    enabled: true,
4  },
5};
  1. Restart your Strapi application:
npm run develop
# or
yarn develop
  1. 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:

SettingDescriptionDefault
Enable PluginTurn on/off automatic slug generationtrue
Source FieldPrimary field to generate slug fromtitle
Fallback FieldBackup field if source is emptyname
Process Rich TextExtract text from Rich Text fieldstrue
Update Existing SlugsUpdate slug when source changestrue
Cyrillic SupportTransliterate Cyrillic to Latintrue

Available Source Fields

  • title - Most common choice
  • name - Alternative naming field
  • label - Label or display name
  • heading - Header or title field
  • caption - 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?

  1. Check console logs for error messages
  2. Verify slug field exists in your content type
  3. Restart Strapi after configuration changes
  4. 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:
2String field extraction
3Rich Text Blocks processing  
4Classic Rich Text (HTML) processing
5Cyrillic transliteration
6Unique slug generation
7Update vs. preserve existing slugs
8Fallback field usage

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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


Made with ❤️ for the Strapi community

Install now

npm install strapi-plugin-auto-slug-manager-a-mi13

STATS

1 GitHub star203 weekly downloads

Last updated

7 days ago

Strapi Version

5.0.0 and above

Author

github profile image for A-mi13
A-mi13

Useful links

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.