← Back to the glossary

Web design · Development · SEO

Slug

URL slugs explained: the readable part of a web address

Editorially reviewed ·

Clear definition

A slug is a readable segment within a URL path that identifies a page or resource, such as seo-audit in /glossary/seo-audit/. Content management systems often generate it from the title, and it may need to be unique within a particular section. Technically, a slug is not necessarily only the final URL segment; the term refers to an editorially generated path component.

Good slugs are understandable, durable, and free from unnecessary words or parameters. Lowercase letters and hyphens support consistent URLs; special characters can be encoded correctly but are often simplified for practical reasons. A keyword in the slug can provide context but does not guarantee rankings. When a published URL changes, the old address should permanently redirect to the corresponding new URL.

Slug in practice

A good slug is short, readable, and durable. Changes need a direct redirect from the previous address; dates, categories, or technology details should only be included when they belong to the long-term URL design.

Digital functions need clear ownership after launch. Provider terms, dependencies, cost, data flows, and failure paths should be documented. Regular reviews show whether a solution is still needed and can be operated safely. Planning adoption without considering updates, cancellation, export, or replacement creates unnecessary technical and organisational risk.

Slug: relevance to SEO, paid search, and GEO

Operational choices affect loading speed, privacy, and the reliability of measurement data. Too many services can slow destinations and complicate consent, while insufficient measurement makes business decisions harder. SEO and paid search need a deliberate balance: use only necessary technology, respect consent, verify essential events, and document dependencies transparently.

For search and answer systems, coverage of Slug should distinguish its definition, scope, and evaluation criteria. The editorial reference is “sanitize_title()” by WordPress Developer Resources, making central claims traceable for readers and machine-based systems.

Practical code example

PHP

Generate a simple URL slug

The function transliterates, lowercases, and replaces unwanted characters. Uniqueness and redirects need separate handling.

<?php
function slugify(string $value): string
{
    $value = transliterator_transliterate('Any-Latin; Latin-ASCII', $value);
    $value = mb_strtolower($value, 'UTF-8');
    $value = preg_replace('/[^a-z0-9]+/', '-', $value);
    return trim((string) $value, '-');
}

echo slugify('Barrierefreie Websites'); // barrierefreie-websites

Sources and further reading

  1. Documentation sanitize_title() WordPress Developer Resources · Checked

Frequently asked questions

A slug is a generally readable, editorially generated segment in a URL path that identifies a page or resource.

Only for a good reason. After a change, the old URL should permanently redirect to the new destination so users and search engines can find it.