Marketing overview

Marketing · Guide

Slug best practices for marketing assets

A slug is any short, machine-friendly identifier — the path segment in a URL, a filename for a creative asset, an export name for a campaign. Good slug habits prevent broken links, duplicate uploads, and CDN cache headaches.

Last reviewed: April 2026

Core rules

These rules apply to URL slugs and filename slugs alike. The small differences are covered in the sections below.

  • Lowercase only. Mixed case breaks on case-sensitive servers.
  • Use hyphens between words, never spaces or underscores in URLs (underscores are fine for filenames).
  • Strip diacritics — café becomes cafe.
  • Keep it under ~60 characters. Long slugs get truncated in search snippets.
  • No trailing punctuation, no leading numbers if avoidable.

URL slugs

Match the page's primary keyword, not its full title. 'How to write a great Google Ads headline' becomes /google-ads-headline-tips, not /how-to-write-a-great-google-ads-headline-2026.

Avoid stop words (the, a, of, and) unless removing them changes meaning.

Don't include the date unless the content is genuinely time-bound. Dates in URLs imply the content has an expiry, which depresses long-term organic performance.

Once published, treat slugs as effectively permanent. Changing a slug requires a 301 redirect — and even with the redirect, you lose some link equity. Get it right the first time.

Filename slugs for creative assets

Add structured tokens so files sort and search well: campaign_channel_format_variant_yyyymm.ext. For example: spring_meta_video_15s_2026_04.mp4.

Underscores are safer than hyphens in filenames, since some tools interpret hyphens specially. Pick one and stay consistent inside each context.

Encode the format and duration where applicable — 15s, 30s, square, vertical — so the filename describes the asset without opening it. Designers, paid media buyers, and partners will thank you.

Slugs in CDNs and caches

Most CDNs key cache entries on the full URL string, including the slug. A trailing slash, an uppercase letter, or a stray query parameter produces a separate cache entry — which means a separate origin fetch and slower performance for users.

If you change a slug, purge the old URL from the CDN explicitly. Otherwise old cached pages can be served alongside the new ones for hours or days, depending on TTLs.

When to break the rules

There are situations where a slightly longer or unusual slug is the right call: long-tail SEO pages targeting a specific phrase, microsites that want the campaign name in the URL, or product pages where a model number is the primary search term. In those cases, document the exception in the style guide rather than treating it as a precedent.

Generate clean slugs

Paste any text into the Slug & Filename Cleaner to get a lowercase, hyphenated, diacritic-free output suitable for URLs or filenames. For files that need structured tokens, generate the base slug then prefix the tokens manually using your team's convention.

Summary

Lowercase, ASCII-safe, separator-consistent, under 60 characters, with the primary keyword for URLs and structured tokens for filenames. Apply the rules consistently and slugs stop being a recurring source of confusion.

Frequently asked questions

Should I use hyphens or underscores in URLs?
Hyphens. Google has historically treated hyphens as word separators in URLs and underscores as part of a single token, so hyphens are more readable to both humans and search engines.
Is it bad to include numbers in a slug?
Numbers are fine if they're meaningful (a product model number, a year for genuinely time-bound content). Avoid arbitrary numeric suffixes like /title-2 — they signal duplicate content to search engines.
Can I change a slug after publishing?
Yes, but always set up a 301 redirect from the old URL to the new one. You'll still lose some link equity, so don't change slugs casually — get them right at publish time and treat the slug as a long-term commitment.

Tools mentioned

Further reading

Browsing all guides? Head back to the Marketing overview or the full tools index.