Slug

Slug

A slug is the readable part of an internet address that names a single page – for example "artificial-intelligence-explained" at the end of a link. It usually consists only of lowercase letters, numbers, and hyphens, and is generated automatically from the title.

Every page on the internet has an address that can be typed into the browser’s address bar. This address is divided into parts: first the name of the website, then often a folder, and at the end the name of the individual page. This last part is called the slug. In the address “exampletimes.com/glossary/slug”, “slug” is the slug. It is deliberately kept short and readable so that people can tell what the page is about just from the address. The term comes from the newspaper trade: there, the slug was the short working label a newsroom used to internally name an article.

What a good slug does for readers and search engines

Addresses are constantly being passed around. People send them via messenger, paste them into presentations, or read them out over the phone. An address ending in “?id=48291&ref=2b” tells nobody anything. An address ending in “ecb-interest-rate-decision-march” reveals the content even before the click. That increases the likelihood that someone will click the link at all.

Search engines read the slug too. It is one of many clues indicating what topic a page covers, and it appears in search results under the heading. Search engine optimization professionals – that is, people concerned with how pages rank high in search results – therefore pay attention to descriptive slugs. The effect is small, but it costs nothing.

There is, however, an important principle: once published, a slug should not be changed again. If it is changed, all previously shared links lead nowhere. Users then see an error page with the number 404. In such cases, editorial teams set up a redirect pointing from the old slug to the new one. This works, but it’s extra work and is easily forgotten.

How a headline becomes a slug

Usually, the website’s software generates the slug automatically from the title. This process follows fixed steps. First, all uppercase letters are converted to lowercase, because some servers treat upper and lower case differently. Then spaces are replaced with hyphens. Hyphens are considered more readable than underscores and are reliably recognized by search engines as word separators.

After that, everything that causes problems in an address is stripped out: punctuation marks, quotation marks, question marks, percent signs. Special characters are replaced or transliterated so the result contains only standard letters. Common filler words like “and”, “the”, or “a” are often removed by many systems as well, so the slug stays short. From the headline “Why Artificial Intelligence Uses So Much Electricity!” this produces something like “why-artificial-intelligence-uses-so-much-electricity”.

A slug must be unique within a website. Two articles must not share the same one, otherwise the server won’t know which page to deliver. If a duplicate occurs, the software usually appends a number: “year-in-review-2”. Editorial teams can also manually override the software’s suggestion if the automatic slug turns out too long or awkward.

Slugs in blogs, shops, and AI glossaries

Anyone running a blog or a website with a content management system sees the field directly. In WordPress, for example, there’s a box labeled “Permalink” next to the headline, where the slug can be edited. The same applies to online shops, where “Running shoe Model X, blue, size 9” becomes a slug like “running-shoe-model-x-blue”.

This glossary also works with slugs. Each entry sits at its own address, the last part of which is the term in lowercase. That’s precisely why entries can be linked to one another without anyone having to look up numbers. Programming interfaces use slugs for the same reason, as a stable identifier for data records.

A common misconception is that the slug is the same as the page title. That’s not the case. The title is the complete, freely worded sentence with special characters and punctuation. The slug is its technically stripped-down short form. The two can resemble each other, but they are separate fields – and the title may change at any time, whereas the slug preferably should not.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.