npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

strapi-auto-slug

v1.0.11

Published

Auto-generate URL-friendly slugs from text fields in Strapi v5

Downloads

99

Readme

Strapi Auto Slug

A custom field plugin for Strapi v5 that automatically generates URL-friendly slugs from any text field in your content types.

Features

  • Real-time slug generation — slugs are generated instantly as you type.
  • Source field selector — pick which text field to generate the slug from using a dropdown.
  • Duplicate handling — automatically appends -1, -2, etc. to ensure uniqueness
  • Configurable behavior — control auto-generation rules per field via the Content-Type Builder
  • API fallback — slugs are also generated server-side for entries created via the API
  • Unicode support — handles diacritics and special characters gracefully

Installation

npm install strapi-auto-slug

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

module.exports = {
  'auto-slug': {
    enabled: true,
  },
};

Rebuild your admin panel:

npm run build

Usage

  1. Open the Content-Type Builder
  2. Add a new field and select the Custom tab
  3. Choose Auto Slug
  4. In the Base settings, select the Source field — a dropdown lists all available text/string fields in the content type
  5. Configure behavior in the Advanced settings tab (see below)
  6. Save the content type

When creating content, the slug field will automatically populate as you type in the source field.

Advanced Settings

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 |

How It Works

In the Admin Panel

  • New entry — the slug auto-generates in real-time as you type in the source field
  • Manual override — editing the slug directly stops auto-generation for that entry
  • Existing entry with a slug — the slug is preserved and won't change even if the source field is modified
  • Existing entry with an empty slug — behaves like a new entry and auto-generates from the source field

On the Server (API)

When entries are created or updated via the REST or GraphQL API (without the admin panel):

  • Create — if no slug is provided, one is generated from the source field
  • Create/Update — if a slug is provided, it is checked for uniqueness and a suffix is appended if needed

Slug Format

The slugify algorithm:

  • Normalizes Unicode and strips diacritics (cafécafe)
  • Converts to lowercase
  • Replaces spaces and underscores with hyphens
  • Removes all non-alphanumeric characters (except hyphens)
  • Collapses consecutive hyphens
  • Trims hyphens from the start and end

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 |

Compatibility

  • Strapi v5.x
  • Node.js >= 18

License

MIT