What is a tag slug?

When you create a tag, WordPress automatically creates a slug from its name. The slug is a URL-friendly and unique version of the name. Spaces are replaced by hyphens (“-“) and the slug is changed to lower-case.

For example the tag

First Tag

will automatically receive the slug

first-tag

Additionally, WordPress makes sure that each slug is unique. In order to achieve that, it may add a number:

first-tag-2

Slugs are only created automatically when the tag is new. If you edit the name of an existing tag, you can delete the slug and then WordPress creates a new slug for you when you save the tag.

Tag slugs appear in some URLs, for example on your tag archive pages (where all posts are listed that use this tag). Your visitors, however, won’t usually notice them. They see only the original tag name on the pages and in the page header.

You can edit a slug but WordPress will again make sure that it is URL-friendly and unique. When changing a slug, some links to the tag archive page might break and need to be updated as well. But usually there is no need to change a slug, even if you decide to change the tag name.

Tag slugs in shortcodes

In some cases you will need to enter the slug in a shortcode. You find the slug in a separate column of the table on the “Tags” page.

Example of a tag with a slug