A slug is the part of a URL that identifies a specific page or post. Take the address of this tutorial:
andersnoren.se/wordpress-tutorials/basics/what-is-a-slug-in-wordpress/
The last part, “what-is-a-slug-in-wordpress”, is the slug. It’s a short, readable version of the title, written in lowercase with hyphens instead of spaces. Every post and page in WordPress has one, and so do categories, tags and authors.
The name comes from newspapers, where a slug was the short working name a story went by before it had a proper headline. On the web, it does the same job: a simple, stable name for the page, which also happens to tell both visitors and search engines what the page is about before they’ve even clicked.
How WordPress creates slugs
You rarely have to think about slugs, because WordPress makes one for you from the title when you publish. It lowercases the title, replaces spaces with hyphens, and removes punctuation and most special characters, so “How to Make a Sticky Header!” becomes “how-to-make-a-sticky-header”.
Slugs have to be unique within the same type of content. If you publish a second page called “Contact”, WordPress gives it the slug “contact-2”. The same thing happens when you duplicate a page, which is why it’s worth fixing the slug of the copy before you publish it. That’s one of the most common reasons to change a slug by hand, along with titles that are too long to make a good URL.
One thing worth knowing: the slug only shows up in your URLs if your permalink structure uses it. Under “Settings” → “Permalinks”, the “Plain” option gives you URLs like “?p=123” instead. Every other option uses the slug, and “Post name” is the one most sites use. New sites have used a slug-based structure by default since WordPress 4.2, back in 2015, though the default is “Day and name” rather than “Post name”. If your site is older than that and you never changed the setting, it might still be set to “Plain”. In that case, I recommend you update it. URLs with post names are better both for readability and for discoverability in search engines. More on that later.
If you looked closely at the URL of this tutorial, you might have noticed something none of those options give you: “/wordpress-tutorials/basics/” before the slug. The tutorials on this site live in their own post type, and their URLs include the tutorial’s category. WordPress has no setting for that, since the permalink options only apply to regular posts, so it takes a custom rewrite rule and a bit of code. That’s a topic for a future tutorial.
How to change a slug
The quickest way is in the editor:
- Open the page or post, and make sure the settings sidebar on the right is open.
- Find “Slug” in the “Page” or “Post” tab, and click the current slug next to it.
- Type the new slug in the field, and save or update the page.

You don’t have to format it yourself: if you type “My New Slug”, WordPress turns it into “my-new-slug” when you save.
If you want to change a slug without opening the editor, hover over the page in the “Pages” list and click “Quick Edit”. The “Slug” field is right below the title.
Categories and tags have slugs too. Go to “Posts” → “Categories” or “Posts” → “Tags”, click “Edit” below the one you want to change, and update the “Slug” field. Custom taxonomies, like WooCommerce’s product categories, work the same way.
Changing the slug of a published page
Changing a slug changes the URL, and that’s fine as long as nobody has found the old one yet. Once a page is published, though, the old URL may be linked from other sites, bookmarked, shared, or indexed by Google. Change the slug, and all of those lead to a “page not found” page instead. Fun as those can be, it’s probably not where you want your visitors to end up.
WordPress handles part of this for you. When you change the slug of a published post, or an item in most custom post types, it remembers the old one and redirects visitors to the new URL automatically. It doesn’t do that for pages, or for categories and tags. For those, you need to set up a redirect yourself, from the old URL to the new one. The free Redirection plugin is what I use, and it’s what I used when I moved this tutorial from its old address. Unlike WordPress itself, you can set up Redirection to automatically add a redirect when you change the slug of a page. It doesn’t watch categories and tags, though, so for those you’ll need to add the redirect by hand.
In short:
- Pick a good slug before you publish.
- Only change it later if you have a good reason to.
- When you do, make sure you have a redirect in place.
What makes a good slug for SEO
Does the slug matter for SEO? A little. Google’s own guidelines recommend readable words in URLs rather than long ID numbers, and hyphens between words rather than underscores, since that helps both people and search engines understand what the page is about. WordPress already takes care of the hyphens for you. The slug also shows up in search results and when someone shares the link, so a clear one can make people more likely to click.
What it won’t do is lift a page up the rankings on its own. It’s a small signal, and the content of the page matters far more. The biggest SEO mistake you can make with slugs isn’t picking a mediocre one, it’s changing one on a page that already ranks without a redirect, and losing the traffic you had.
With that in mind, a good slug is short, readable, and tells you what the page is about. A few guidelines:
- Keep it short. Three to five words is usually enough. “how-to-make-a-sticky-header-in-a-wordpress-block-theme-step-by-step” says nothing “sticky-header” doesn’t, and keyword maxxing works as well in slugs as it does anywhere else, which is not at all.
- Use the words people search for. If people search for “duplicate page wordpress”, that phrase belongs in the slug.
- Leave out dates and numbers that will change. A slug like “best-themes-2025” becomes outdated the moment the year changes, and then you’re back to changing slugs and setting up redirects.
- Don’t worry about small words. Removing “a”, “the” and “in” makes slugs shorter, but keeping them makes them easier to read. Either is fine, as long as you’re consistent.
A good slug takes ten seconds to write before you publish. Fixing it afterwards takes a redirect.