hebrew-slugify
v1.0.1
Published
Slugify Hebrew text for URLs — transliteration + slug generation
Maintainers
Readme
hebrew-slugify — Hebrew Text to URL-Safe Slug Transliteration
Turn Hebrew text into clean, URL-safe slugs — with transliteration, niqqud stripping, and mixed Hebrew-English support. Zero dependencies, TypeScript.
hebrewSlugify("שלום עולם"); // → "shlvm-avlm"
hebrewSlugify("פוסט 42 בבלוג"); // → "pvst-42-bblvg"
hebrewSlugify("שלום Hello World"); // → "shlvm-hello-world"הפיכת טקסט עברי ל-slug עבור כתובות URL — תעתיק + יצירת slug. ללא תלויות.

Install
npm install hebrew-slugifyUsage
import { hebrewSlugify } from "hebrew-slugify";
hebrewSlugify("שלום עולם");
// → "shlvm-avlm"
hebrewSlugify("פוסט 42 בבלוג");
// → "pvst-42-bblvg"
hebrewSlugify("שלום Hello World");
// → "shlvm-hello-world"
// Handles niqqud (vowel marks)
hebrewSlugify("שָׁלוֹם");
// → "shlvm"Options
hebrewSlugify("שלום עולם", { separator: "_" });
// → "shlvm_avlm"
hebrewSlugify("Hello World", { lowercase: false });
// → "Hello-World"
// Keep Hebrew characters (no transliteration)
hebrewSlugify("שלום עולם", { transliterate: false });
// → "שלום-עולם"| Option | Type | Default | Description |
| --------------- | --------- | ------- | ----------------------------- |
| separator | string | "-" | Character between words |
| lowercase | boolean | true | Convert to lowercase |
| transliterate | boolean | true | Transliterate Hebrew to Latin |
Transliteration Table
| Letter | Transliteration | Letter | Transliteration | | ------ | --------------- | ------ | --------------- | | א | a | מ ם | m | | ב | b | נ ן | n | | ג | g | ס | s | | ד | d | ע | a | | ה | h | פ ף | p | | ו | v | צ ץ | ts | | ז | z | ק | k | | ח | ch | ר | r | | ט | t | ש | sh | | י | y | ת | t | | כ ך | k | ל | l |
Features
- Transliterates Hebrew letters to Latin characters
- Strips niqqud (vowel marks) automatically
- Handles mixed Hebrew + English + numbers
- Strips accented Latin characters (café → cafe)
- Collapses consecutive separators
- Zero dependencies
- Full TypeScript support
- ESM + CommonJS
API
hebrewSlugify(text: string, options?: SlugifyOptions): string
Converts a string (Hebrew, English, or mixed) into a URL-safe slug.
Looking for a WordPress plugin?
This library is also available as a WordPress plugin: hebrew-slugify-wp — same transliteration logic, auto-applied to post/page slugs. Works with Gutenberg, Elementor, WooCommerce.
Author
Ofer Shapira
