URLify
Fast PHP slug generator and transliteration library for turning any string into a clean URL.
Repository Health
Technical Analysis
URLify is a PHP library for generating URL-safe slugs from arbitrary strings, including non-ASCII text. It transliterates accented Latin, Cyrillic, Greek, Arabic, Turkish, Ukrainian, Czech, Polish, and other alphabets down to their closest ASCII representation, then applies a configurable stop-word filter and separator (typically a hyphen) to produce a clean slug suitable for a URL path.
As a static utility class with no framework dependency, it’s a common building block behind “generate slug from title” behavior in PHP blogging platforms, static-site generators, and CMSes — the library itself originated from and is still used inside the Chyrp blogging engine.
What You Get
URLify::filter($string)for full string-to-slug conversion in one callURLify::transliterate()for converting non-ASCII characters to ASCII without slugifyingURLify::downcode()for the raw character-mapping step- Per-language stop-word removal via
remove_words()andreset_remove_list() add_chars()/add_array_to_separator()to extend or override the built-in transliteration and separator maps
Common Use Cases
- Auto-generating a URL slug from a blog post or page title on save
- Normalizing user-generated content (usernames, tags, filenames) into URL-safe or filesystem-safe strings
- Building SEO-friendly URLs from titles containing accented or non-Latin characters
- Stripping common stop words (“a”, “the”, “and”) from slugs for cleaner, shorter URLs
Under The Hood
Architecture: URLify.php is a single static class exposing filter(), transliterate(), downcode(), and related helpers, built around large static transliteration maps (per-language character-to-ASCII lookup tables) and stop-word lists that are lazily merged/configurable via add_chars() and remove_words(); filter() composes downcode -> stop-word removal -> separator-join into the one common slugify call. Tech Stack: Plain PHP 7.2+, with voku/portable-ascii and voku/stop-words as its only two runtime Composer dependencies (delegating the heavy lifting of ASCII-portability and stop-word datasets to those focused libraries rather than reimplementing them). Code Quality: A compact ~600-line main file, tested with PHPUnit, linted via PHP CS Fixer (phpcs.php_cs) and statically analyzed with PHPStan (phpstan.neon) — modest but consistent tooling for a utility of this size and age (predates PSR-4, still using PSR-0 autoloading). API Design: The single most-used entry point (URLify::filter($string)) covers the common case in one static call, while the lower-level transliterate()/downcode() methods and the add_chars()/remove_words() customization hooks are there for callers who need finer control over the mapping or stop-word behavior.
Used by 2 apps in this directory
Mautic
Automation · Marketing · Ecommerce
The world's largest open source marketing automation platform — own your data, run multi-channel campaigns, and escape vendor lock-in forever.
Typemill
CMS
Open-source flat-file CMS for publishing Markdown-based documentation, manuals, and eBooks without a database.