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 content types with Rich Text support

✨ Features

  • Universal - Works with ANY content type that has a slug field
  • Rich Text Support - Extracts text from both Rich Text Blocks (new editor) and classic Rich Text (HTML) fields
  • Multiple Field Types - Supports string, Rich Text Blocks, and classic Rich Text fields
  • Cyrillic Support - Proper transliteration of Russian/Cyrillic characters
  • Smart Uniqueness - Automatically adds suffixes (-1, -2, -3) for unique slugs
  • Auto-discovery - Automatically finds and processes all content types with slug fields
  • Configurable - Update existing slugs or keep them unchanged
  • Admin Panel - Beautiful settings interface with real-time configuration
  • Zero Configuration - Works out of the box with sensible defaults
  • 🌐 Multi-locale Support - Choose from 8 different locales for transliteration (ru, en, de, fr, es, it, pl, tr)
  • 🎛️ Easy Configuration - Change locale directly from admin panel without code editing

🚀 Installation

npm install strapi-plugin-auto-slug-manager-a-mi13
# or
yarn add strapi-plugin-auto-slug-manager-a-mi13

⚙️ Configuration

Add the plugin to your config/plugins.js or config/plugins.ts:

1module.exports = {
2  'auto-slug-manager': {
3    enabled: true,
4    config: {
5      enabled: true,                    // Enable/disable plugin globally
6      sourceField: 'title',             // Primary field to generate slug from
7      fallbackField: 'name',            // Fallback field if primary is empty
8      handleRichText: true,             // Process Rich Text (blocks) fields
9      addSuffixForUnique: true,         // Add suffixes for uniqueness
10      supportCyrillic: true,            // Support Cyrillic transliteration
11      updateExistingSlugs: true,        // Update existing slugs when title changes
12      slugifyOptions: {
13        lower: true,
14        strict: true,
15        locale: 'ru'
16      }
17    }
18  }
19};

📖 Usage

  1. Add a slug field to any content type in your Strapi schema
  2. Create or edit entries - slugs will be automatically generated from title or name fields
  3. Rich Text support - Works with both regular string fields and Rich Text editor fields

Example Content Type Schema

1{
2  "kind": "collectionType",
3  "collectionName": "articles",
4  "info": {
5    "singularName": "article",
6    "pluralName": "articles",
7    "displayName": "Articles"
8  },
9  "attributes": {
10    "title": {
11      "type": "blocks"
12    },
13    "slug": {
14      "type": "uid",
15      "targetField": "title"
16    }
17  }
18}

🎯 How it Works

  1. Auto-discovery: Plugin scans all content types for slug fields
  2. Lifecycle hooks: Registers beforeCreate and beforeUpdate hooks
  3. Smart text extraction: Automatically detects and processes different field types:
    • String fields → direct text extraction
    • Rich Text Blocks → extracts text from JSON structure
    • Classic Rich Text → strips HTML tags and extracts clean text
  4. Slug generation: Uses slugify with Cyrillic support
  5. Uniqueness check: Ensures all slugs are unique within the content type

🔧 API Endpoints

The plugin provides API endpoints for managing settings:

  • GET /auto-slug-manager/settings - Get current settings
  • PUT /auto-slug-manager/settings - Update settings
  • GET /auto-slug-manager/status - Get plugin status and discovered content types

📝 Field Types Supported

Rich Text Blocks (New Editor)

1{
2  "title": [
3    {
4      "type": "paragraph",
5      "children": [
6        {
7          "type": "text",
8          "text": "My Article Title"
9        }
10      ]
11    }
12  ]
13}

Rich Text (Classic Editor)

1{
2  "title": "<h1>My Article Title</h1><p>Some description</p>"
3}

Regular String

1{
2  "title": "My Article Title"
3}

All three will generate: my-article-title

🌍 Multi-locale Support

The plugin supports 8 different locales for transliteration. You can change the locale directly from the admin panel:

Available Locales

LocaleLanguageExample
ruRussianМоя статьяmoya-statya
enEnglishMy Articlemy-article
deGermanMein Artikelmein-artikel
frFrenchMon Articlemon-article
esSpanishMi Artículomi-articulo
itItalianIl Mio Articoloil-mio-articolo
plPolishMój Artykułmoj-artykul
trTurkishBenim Makalembenim-makalem

How to Change Locale

  1. Go to Admin Panel → Settings → Auto Slug Manager
  2. Find "🔧 Настройки генерации слагов" section
  3. Select your preferred locale from the dropdown
  4. Click "Сохранить настройки"

Examples

Russian locale (ru):

  • Моя статьяmoya-statya
  • Тестовая записьtestovaya-zapis

English locale (en):

  • My Articlemy-article
  • Test Entrytest-entry

🔧 Development

# Clone the repository
git clone https://github.com/A-mi13/strapi-plugin-auto-slug-manager
cd strapi-plugin-auto-slug-manager

# Install dependencies
npm install

# Build the plugin
npm run build

🤝 Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

📄 License

MIT License - see LICENSE file for details.

🐛 Issues

Found a bug? Please create an issue on GitHub.

📦 Related


Made with ❤️ for the Strapi community

Install now

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

STATS

3 GitHub stars126 weekly downloads

Last updated

1 day 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.