WordPress Tags Explained

Share this article

By default there are two features in WordPress which help us to sort our content: categories and tags. Some plugins and themes add their own taxonomies but these two are the most commonly used, as everyone has them.

But some users don’t know why we have both of these. After all, categories are fine to sort posts, so a second way to sort them can seem useless. But it’s not the case.

In this article, we will see why WordPress tags are useful. Right after, as you’ll surely want to use them, I’ll show you how to add, edit and delete tags. We’ll finish by covering the default widget WordPress provides to display tags.

If you’re not familiar with how categories are used in WordPress you can refer to my article WordPress Categories Explained.

Are Tags Really Useful?

I sometimes encounter people who ask if tags can be useful, and how to use them. As a blogger I write several articles per day so I know that tags can be really useful. Now it’s time for me to show you exactly how useful they can be.

Tags can complete the sorting you do with categories. However, they aren’t subcategories, and suggesting that they’re subcategories is wrong (you can already create subcategories with the categories system).

Tags are keywords.

It’s a very short definition (from my point of view) but it’s the one you should keep in mind when you want to add a tag to your post.

Let’s take an example to help clarify the definition. Assume that you have a category named “Pictures” with a subcategory named “Cute Animals”. One day, you’ll post a picture of a cute kitty in this category. For this post, you can create a tag named “Kitties” or “Cats”, and you’ll give this tag to all your cat pictures.

At this point, tags might still seem useless, since a “Cats” subcategory could handle this.

Now let’s assume that you have another category named “Around the Web” where you post things you come across that are interesting and must be shared. One day, you find an infinitely interesting website with a lot of cats. For that post, you could still create a “Cats” subcategory under “Around the Web”, but that’s two categories with the same name. This is a good example of where tags might be a better choice.

It’s just an example, but it helps demonstrate that tags are like categories, but they aren’t categories, they complement them. They are a way to sort posts, but they can appear in several categories. That’s why we can’t see them as simple subcategories.

Thinking about reusing the tags you want to add is a good idea. Using tags for sorting your posts is fine, but having dozens of tags per post is not. To find the right balance, think about a book index: in this index you want to find a complete list of keywords, but not a list polluted by useless words like “the”.

Managing Tags

Adding a Tag

From the Tags Manager

You can find the list of the tags you use in the “Tags” entry of the “Posts” menu in your administration panel. The structure of this page should be familiar to you if you have used the Categories manager, as it is essentially the same.

To create a new tag you can, as for a category, use the form on the left. There are three fields, but only the first one is required: the name of the tag, the one which will be seen by the user.

The slug is used in the URLs if you enabled URL Rewriting. Typically, it’s the name of the tag, optimized for a URL (in lowercase, without any space or special character). If you leave this field blank, then WordPress will automatically generate the slug from the name of the tag, so if that’s what you would have done anyway you can leave this field blank.

You can add a description to your tag, but it’s optional. Some themes display the description when the user displays the list of posts which have a given tag assigned to them. However, it’s not a feature used by every theme, so before filling a potentially useless field, be sure that your theme will display this description, or that you want to use the description to define the role of the tag in the administration panel.

add a tag

Contrary to what we found in categories, there’s no relationships in the tags: you can not set a tag as a child of another tag. A “child keyword” doesn’t make much sense.

From the Editor

If you want to use tags, it’s worth knowing that there is another way to add a tag, more used in practice as it takes place in the editor.

When you add a new post or when you edit one, you can find a “Tags” block. In this block you’ll find a field in which you can type your tag and hit the “Add” button.

When you hit this button, WordPress will associate your post with the tag you just typed. If this tag wasn’t already created before, it will now exist and you will be able to use it in other posts.

To go faster, you can simply hit the “Enter” key on your keyboard instead of hitting the “Add” button. You can also assign several tags by separating them with commas. As a consequence, you can’t use a comma inside the name of a new tag from this field (you can, but only from the Tags manager seen above). To finish, note that WordPress will automatically retrieve for you the tags which contain the letters you are typing, which can be useful to be sure you won’t create by accident a new tag too close to an existing one.

Add a WordPress tag

Below this field you’ll find the list of tags used for the current post. You can hit the cross icon visible next to each tag to remove it from the post you are editing. However, this won’t delete the tag: it will still exist in the tags list, even if no post is using it.

Editing and Deleting a Tag

Editing or deleting a tag is exactly as per editing or deleting a category. You find the right tag in the list (in the Tags manager), you hover over it, and the options are displayed.

Edit or delete a tag

Be careful: deleting a tag can’t be undone. If some posts were using this tag, it will be removed from the list of tags used.

If you edit a tag, the modification will be visible on posts the tag is assigned to. This can be useful if you added a tag in several posts and noticed a mistake in the tag name: by editing the tag itself, the mistake will be fixed in every post.

Displaying the Tags with the Default Widget

Your theme should normally display the tags used on every post. But what if you want to display the list of tags you use everywhere, as for the categories?

A list of tags can be useful to let your users know the topics you talk about on your blog. To let you do that, WordPress provides a default widget allowing you to display a “tag cloud”.

The tag cloud is basically a succession of links pointing to the tags you use, separated by a space. A bit of CSS is used to enhance it.

Tag Cloud

By default, WordPress sets the font size of each link, in a style attribute. This size is calculated from the number of posts using each tag: the more a tag is used, the larger it will be. Then, your visitors can directly identify the more recurrent topics on your blog: they will be displayed in a bigger size than the other ones.

Note that, if you use many tags, this widget won’t display all of them. In fact, WordPress will only display the 45 most used tags. That way, you can use hundreds of tags without worrying about the size of this widget.

In Conclusion

Tags are a good way to sort your content using keywords. They can help your users find the topics of interest to them, and they can be useful in many blogs.

For example, if you have a cooking blog, you can use tags to help classify your content by the ingredients used. If your blog is focused on high-tech devices, you can tag your posts according to the device you are discussing. There are endless possibilities.

In this article I described how tags work and how to use them. In a future article, we will go further, by playing with the Tags API in order to see how to display our tags in the way we want.

Frequently Asked Questions about WordPress Tags

How can I add tags to my WordPress posts?

Adding tags to your WordPress posts is a simple process. First, navigate to your WordPress dashboard and select ‘Posts’. Choose the post you want to add tags to and click ‘Edit’. On the right-hand side, you’ll see a section labeled ‘Tags’. Here, you can type in the tags you want to add, separating each one with a comma. Once you’ve added all your tags, click ‘Update’ to save your changes. Remember, tags are useful for organizing your content and helping users find related posts.

Can I display a list of all the tags on my WordPress site?

Yes, you can display a list of all the tags on your WordPress site. This can be done by using the ‘Tag Cloud’ widget. Navigate to ‘Appearance’ then ‘Widgets’ on your WordPress dashboard. Drag the ‘Tag Cloud’ widget to the desired area, such as your sidebar or footer. This will automatically display a list of all your tags.

How can I remove tags from a WordPress post?

Removing tags from a WordPress post is as easy as adding them. Go to your WordPress dashboard and select ‘Posts’. Choose the post you want to remove tags from and click ‘Edit’. In the ‘Tags’ section on the right-hand side, click on the ‘X’ next to the tag you want to remove. Don’t forget to click ‘Update’ to save your changes.

What is the difference between tags and categories in WordPress?

While both tags and categories are used to organize content in WordPress, they serve different purposes. Categories are used for broad grouping of your posts. Think of these as general topics or the table of contents for your site. Tags, on the other hand, are more specific and describe the details of your posts. They are like the index words at the end of a book.

How many tags should I use per post in WordPress?

There’s no hard and fast rule for the number of tags you should use per post in WordPress. However, it’s important to keep them relevant and useful. Using too many tags can make your content seem disorganized and can confuse readers. A good rule of thumb is to stick to 5-10 tags per post.

Can I use spaces in my WordPress tags?

Yes, you can use spaces in your WordPress tags. When you type a tag with a space, WordPress will treat it as two separate words. For example, if you type “apple pie”, WordPress will create a tag for “apple” and a separate tag for “pie”.

How can I edit the slug of a tag in WordPress?

To edit the slug of a tag in WordPress, go to ‘Posts’ then ‘Tags’ on your WordPress dashboard. Click ‘Edit’ under the tag you want to change. Here, you can edit the slug, which is the URL-friendly version of the tag. Remember to click ‘Update’ to save your changes.

Can I convert tags into categories in WordPress?

Yes, you can convert tags into categories in WordPress. This can be done by using the ‘Categories and Tags Converter’ under ‘Tools’ then ‘Import’ on your WordPress dashboard. Follow the prompts to convert your tags into categories.

How can I display the most popular tags on my WordPress site?

Displaying the most popular tags on your WordPress site can be done by using the ‘Tag Cloud’ widget. This widget will automatically display your most used tags more prominently. Simply navigate to ‘Appearance’ then ‘Widgets’ on your WordPress dashboard and drag the ‘Tag Cloud’ widget to the desired area.

Can I delete unused tags in WordPress?

Yes, you can delete unused tags in WordPress. Go to ‘Posts’ then ‘Tags’ on your WordPress dashboard. Here, you can see a list of all your tags. Click ‘Delete’ under the tag you want to remove. Be careful, as this action cannot be undone.

Jérémy HeleineJérémy Heleine
View Author

Currently a math student, Jérémy is a passionate guy who is interested in many fields, particularly in the high tech world for which he covers the news everyday on some blogs, and web development which takes much of his free time. He loves learning new things and sharing his knowledge with others.

ChrisBtagsWordPress
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week
Loading form