Slug
A slug is the part of a web address that names one post, page, category or tag. WordPress makes it from the title, in lowercase with hyphens for spaces. You can change it, and changing it changes the page's address.
- By
- WP Ministry
- Published
In short
- The slug is the part of the address that belongs to one item, such as "contact" in example.com/contact/.
- WordPress makes it from the title when you first save. Set it yourself before you publish.
- Changing a slug changes the address. WordPress forwards the old address of a post, but not of a page, a category or a tag.
In the address https://example.com/blog/how-to-bake-bread/, the slug is how-to-bake-bread. It names that one post. The rest of the address comes from the site's permalink settings, which decide the pattern every address follows. The slug is the piece that differs from one post to the next.
Posts, pages, categories, tags and authors each have a slug.
How WordPress makes a slug
When you first save a post, WordPress turns its title into a slug. It lowercases the title, replaces spaces with hyphens, converts accented letters to plain ones, and drops anything that is not a letter, a number, an underscore or a hyphen. "Our Café: Opening Hours" becomes our-cafe-opening-hours.
Two items of the same kind cannot share a slug. If the one you want is taken, WordPress adds a number to the end, such as contact-2. A slug ending in a number you did not type means something else already holds the name. For a page it is often an uploaded image, because media files have slugs too.
Where to change it
- A post or page: in the editor, the settings sidebar shows the address, and selecting it opens a field for the slug. In the list of posts or pages, Quick Edit has a field named "Slug".
- A category or tag: go to Posts, then Categories or Tags, and edit the item. The field is named "Slug".
What happens to the old address
For a published post, WordPress remembers the old slug and forwards visitors from the old address to the new one.
It does not do this for pages, and it does not do it for categories or tags. Change one of those and the old address answers "not found" for anyone who follows an old link, search engines included. If the page has been live for a while, add a redirect from the old address to the new one when you change it.
Choosing a good one
- Keep it short and made of the words someone would search for:
wordpress-backupand nothow-to-make-a-backup-of-your-wordpress-site-in-2026. - Leave out dates and numbers that will go out of date.
- Set it before you publish. After that, leave it alone unless there is a real reason to change it.
Common questions
Is a slug the same as a permalink?
No. The permalink is the whole address of a page. The slug is the one part of it that names that page. The pattern for the rest is set under Settings, then Permalinks.
Why does my slug end in -2?
Something else already uses that slug: another page or post, or a media file with the same name. Change the other item's slug or delete it, and then you can set the one you wanted.
My address shows ?p=123 and no slug. Why?
The site is using the "Plain" permalink setting, which leaves slugs out of addresses. Choose another structure under Settings, then Permalinks. If posts then answer "not found", see how to fix 404 errors on posts and pages that exist.

