How slugs and page addresses are made

v0.0.3

A slug is the part of an address that names a post, a category, a tag or a page. The migration makes each slug the way the CMS stores it, so a record matches what the CMS itself would write and a later run finds it again. This page explains what stays, what is changed and what is generated when a WordPress slug has no letters the site can keep.

What it moves and how it works, on one page: Mishka CMS Migration.

What a slug keeps

The slugs are made by the mishka_slug library, the one Mishka CMS uses. It keeps the scripts of the languages the site publishes in and removes Latin accents.

  • A Persian or Arabic post, tag or category slug is imported unchanged on a site that publishes in that language. The slug وردپرس stays وردپرس.
  • Latin accents are removed. café becomes cafe.

When nothing is left

A slug that the site's languages keep nothing of, such as وردپرس on a site that publishes in English alone, is replaced by a generated ASCII slug: the kind of the record, a hyphen and eight characters taken from the text, such as tag-1a2b3c4d. The same text always gives the same slug, so a later run and a post's link to the tag find it. The report says so with Its address was made ASCII, so the old address is not served.

Page addresses

A page's path is the path of its address at the source, one segment at a time. Each segment is decoded and written in Latin letters, so /Café becomes /cafe. A segment with no Latin letter at all, such as /fa/وردپرس, is written as page- and eight characters taken from the segment, such as /fa/page-1a2b3c4d. The same segment always gives the same name, so the pages under it stay under it and a link to it finds it. The old address is not redirected.

Files, folders and menu components

Media files, media folders and the components of menus are named as the CMS names them, in lower case, so Hero is hero.

Slug conflicts

A category or a tag the site already holds is found by the slug the Blog stores for it, so it is matched exactly. The item then waits for your decision: Connect to the existing record, or Import as new with another slug, which writes its slug followed by its source id, such as elixir-10. See Settle what needs your decision.