Overview
Auto Slug adds a custom field type to Strapi v5. The field knows which text field it derives from, generates in the admin panel as you type, and enforces uniqueness on write.
The interesting part is not turning a title into a slug. That is twenty lines. The interesting part is deciding when to stop doing it, which is why five of the settings are about when not to regenerate.
Motivation
I wrote the same lifecycle hook for the third time, slightly differently each time, and decided to package it instead of writing it a fourth.
The specific thing that pushed me over was the split between the admin panel and the API. A hook written for the admin does not run when an entry arrives over REST, so slugs go quietly missing, and I had been patching that per project.
Decisions
A custom field travels with the content type and is configured in the Content-Type Builder. A hook sits in project code where the next developer has to know it exists. This was the whole reason to build it as a plugin rather than paste a snippet.
Generate on creation, stop after a manual edit, preserve on edit, backfill empty slugs, and require a value. A blog post and a landing page want different answers, so these are per field rather than per project.
Normalize Unicode and strip diacritics, lowercase, spaces and underscores to hyphens, drop everything else, collapse repeats, trim the ends. Admin and server run identical rules, and tests cover them, because two implementations of this will disagree eventually.
Friction
Once somebody hand-edits a slug, regenerating from the title silently destroys their work. Tracking that handover per entry, and getting it to survive a page reload, was more fiddly than the slug logic itself.
A published entry must keep its slug, because links depend on it. An entry with an empty slug should behave like a new one. Most of the admin-side code is separating those two cases.
The state of it
The limitations, in plain terms. Every project here is something I built and use, not something I am selling.
Stack
It is a small plugin that does one thing. In the Content Manager it looks like an ordinary text field that fills itself in, which is the point.
It targets Strapi v5 only. I have no plans to support v4.
Uniqueness is checked with a query and then a write, so a genuinely concurrent create could still collide. In a CMS admin that has not happened to me, but it is not airtight.
I maintain it because I use it. Issues get looked at when I have time, not on any schedule.
Next project