Slug (URL Slug)

A human-readable identifier used in the path portion of a URL. Affects SEO and usability.

A slug is a human-readable identifier used in the path portion of a URL. For example, in https://example.com/blog/seo-tips, seo-tips is the slug. Used in many CMS platforms including WordPress to determine article and page URLs, slugs play an important role in website information architecture. The term originally referred to short identifying names for articles in the newspaper industry.

From an SEO perspective, it is desirable that the page content can be inferred from the slug. Google's guide on URL structure, however, does not describe URLs as a ranking factor; what it gives is a readability guideline to separate words and keep the URL easy to understand. The same guide recommends hyphens (-) rather than underscores (_) to separate words, on the grounds that they help users and search engines identify the concepts in a URL. Underscores are a notation for a single unbroken name in identifiers, so they are not recommended as separators, and joining words together without any separator is also a form to avoid.

Slugs can be auto-generated from titles or manually set. Auto-generation typically involves converting the title to lowercase, replacing spaces with hyphens, and removing special characters. English titles produce natural slugs, but Japanese titles require romanization or replacement with English keywords. WordPress allows manual slug editing in the post editor.

Slugs typically use ASCII characters (lowercase letters, numbers, hyphens). Japanese characters can also be used in slugs, and Google's guide allows words in the reader's language in URLs, on the premise that non-ASCII characters are percent-encoded into strings like %E6%9D%B1%E4%BA%AC. ASCII tends to be chosen in practice because such encoded strings become long and break easily when pasted into email or chat, whereas the address bar shows the original Japanese again, so a slug in the reader's language can convey the content better when it is read in search results or the address bar.

Changing slugs requires caution. Modifying a published page's slug changes its URL, invalidating external links and bookmarks. When changes are necessary, a 301 redirect from the old URL to the new one must be configured to preserve SEO value. For this reason, slugs should be carefully determined before publication.

In practice, an English slug is kept to around 3 to 5 words. Removing unnecessary articles (a, the, and) and stop words, and focusing on keywords that represent the content's core, creates concise and effective slugs. From a character counting perspective, slug length directly affects overall URL length. The limit that actually applies here comes from the sitemap specification: the sitemaps.org protocol requires each URL listed in a sitemap to be less than 2,048 characters, so stacking a long slug on a deep path can run into this constraint or into system-specific URL length limits.

Share this article