What makes a readable slug, per Google's URL rules
Google's URL structure advice covers the whole URL, so it covers the slug too.
Words, not IDs. Google recommends readable words in URLs instead of long ID numbers. Google says a URL made only of random identifiers is less helpful for users.
Hyphens. Google recommends hyphens, not underscores, to separate words in a URL. Google gives the reason: a hyphen clearly marks a word boundary, while underscores often join words that belong together (as in code identifiers).
Language. Google recommends URL words in the language of the audience, transliterated where applicable. Google says non-ASCII characters in links to your own pages should be percent-encoded.
Case. Google handles URLs as case-sensitive:
/APPLEand/appleare two different URLs to Google. If the server treats upper and lower case as the same, Google recommends converting all URL text to one case.
Keywords, CMS slug fields and slug changes
Google says keywords in the domain name or URL path alone have almost no ranking effect beyond their appearance in breadcrumbs. Advice that a keyword slug boosts SEO overstates this. Readers still see the slug: Google can show parts of a URL as breadcrumbs in search results, so readers use the URL to judge a result. Google learns breadcrumbs automatically from the words in the URL; structured data can also influence them.
Slugs in WordPress and Sanity
WordPress. In WordPress, the Slug setting in the editor's settings sidebar controls the permalink. It pre-fills a URL-friendly version of the title, editable once the post is saved as a draft. The WordPress glossary describes a post slug as a few lowercase words separated by dashes.
Sanity. Sanity has a
slugschema type whose input shows an error when the slug is not unique. The value is stored oncurrent, for examplethis-is-the-titlefrom a title field. With the default slugify function,maxLengthcaps a generated slug at 200 characters by default.
Changing a slug
Renaming a slug changes the page's URL. So every renamed slug needs its old URL mapped to the new one; Google calls that mapping important. Google says 301 and other permanent redirects do not lose PageRank, so a redirected old slug passes its link credit. For redirect mapping across a whole site, see how to make a proper CMS-to-CMS migration.
How Pagepro handles slug changes after launch
Pagepro pairs the redirect map with a redirect manager in Sanity that editors use, so a renamed slug gets its redirect without a developer. To compare CMSs on this kind of editor control, see the best headless CMS for marketing.
Sources
- Slug - MDN Web Docs GlossaryMozilla (MDN) · developer.mozilla.org
- URL structure best practices for Google SearchGoogle · developers.google.com
- SEO Starter GuideGoogle · developers.google.com
- Site Moves and MigrationsGoogle · developers.google.com
- Settings Sidebar - WordPress DocumentationWordPress.org · wordpress.org
- Glossary - WordPress DocumentationWordPress.org · wordpress.org
- Slug - Sanity DocsSanity · sanity.io