Using Categories and Tags Effectively in WordPress

Using Categories and Tags Effectively in WordPress

Categories and tags are the two primary taxonomies WordPress makes available for organizing content, but how to use them effectively has long been a source of confusion for site admins.

There’s been a lot of debate about their respective merits over the years and even experienced users often waste an unnecessary amount of time agonizing over unnecessary minutiae – particularly when it comes to the subject of SEO.

In this article, we’ll take a straightforward approach and guide you through how to use both categories and tags effectively, with a strong emphasis on putting content and usability first.

An Overview of Category and Tag Basics

Categories were originally the only taxonomy option available to users and tags were introduced into the mix in WordPress 2.3; you’ve doubtless come across their handy interfaces on hundreds of post pages in the back end ever since.

Adding categories and tags on a post page.
Adding categories and tags on a post page.

Before we get into each option in detail, here’s a review of the basics:

  • Location: By default, both categories and tags can only be used on posts, not pages
  • Use: Every post needs to have at least one category, whereas tags are entirely optional
  • Hierarchy: Categories can be placed into hierarchies with multiple levels of sub-categorization whereas the structure of tags is entirely flat

Perhaps the easiest way of thinking about respective uses of categories and tags is to take the example of a book. Categories can be thought of as chapters grouping similar broad topics together, whereas tags act much more like an index.

To take a specific example, if you’re running a site about cookery, you might use categories to group cuisines from the same region together with headings for Italian, French, Indian etc. You’d also have the option of drilling down further with sub-categories/child categories if you wanted.

If, on the other hand, you wanted to be able to target dishes using specific ingredients (i.e. information that spans multiple categories), tags would be an excellent option to deploy. Clicking on the tomato tag, for example, would return tomato-based recipes from around the world.

Setting Up Categories

Before you dive into creating categories, it’s worth spending some time thinking about structure upfront.

Your category list will naturally expand over time – and sub-categories may well eventually be necessary – but you want to keep things relatively tight here. Again, think of this in terms of book chapters to begin with. If you’re finding yourself with initial lists of over 15 categories, it could be time for a re-think.

While you’re free to add new categories from individual posts, the main category interface is found at Posts > Categories. As you can see from the image below, this displays lists of current categories with use counts for easy management and gives you a quick way of adding new ones.

The main WordPress category management page.
The main WordPress category management page.

Let’s briefly step through the options shown above for creating a category:

  • Name: This is what you’ll see listed on the front-end depending on how your theme is set up. Go for obvious names that will both make instant sense to your users and, ideally, also contain a relevant keyword. Keep them as short as possible and pick a consistent capitalization option and stick to it.
  • Slug: This is the URL-friendly version of your name which will appear in both category archives and post URLs if you’re using custom permalinks – we’ll cover both these scenarios in detail later. For now, remember to use dashes to separate words, omit stop words, and avoid keyword stuffing.
  • Parent: Use this to assign an item as a sub-category or leave at None to make it a top-level category.
  • Description: Whether this is actually used anywhere depends on your theme and whether you are explicitly calling it.

Each post can be assigned to more than one category but, again, you want to keep things straightforward here to avoid potentially baffling users.

Try to keep the number of categories a post is filed under to a maximum of two – one is ideal. If you need to highlight extra bits of information that can be found elsewhere on your site, you’ve always got the option of using tags.

Depending on the nature of your site, you might find the default option of Uncategorized less than useful and wish to assign a different one such as General Thoughts, for example. If that’s the case, simply edit the details via the main Categories page and you’re good to go.

Categories and Permalinks

As we covered in the recent guide to permalinks here on the blog, you’ve also got the option of including categories in your URLs by using custom permalinks.

To do this, you’ll need to visit Settings > Permalinks and use the %category% structure tag as part of your Custom Structure. Here’s an example:

Using categories in permalinks.
Using categories in permalinks.

In the example above, we’ve taken the decision to go with category/postname as the custom URL structure, so a post with the slug my-music-post and a category slug of classical would show up as pictured below:

Classical music category example.

Bear in mind that you want to make a decision on what sort of custom permalink format to use as early in the life of your site as possible to save having to mess about with redirects down the line.

While you’ll see arguments pushing the merits of using categories in permalinks for SEO purposes online, it’s by no means a decisive factor. Consider it primarily in terms of value to your users rather than potential payoffs for search engines.

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

A quick browse through the voluminous WPMU DEV blog archives shows that huge amounts of content can be efficiently indexed without having to use categories in permalinks (though they are used elsewhere on pages as shown below).

WPMU DEV category example.
Categories being highlighted on WPMU DEV.

Setting a Custom Category Base

If you followed along by visiting Settings > Permalinks in the previous section, you’ll have noticed another setting marked as Optional for controlling what’s referred to as your category base.

Optional category base screen.
Optional category base screen.

This gives you the ability to change what comes before individual category names in your category archive pages. In the example below, I’ve changed the category base to music which you can see appearing in the Classical category’s archive page URL.

Permalink example.

Whether to use a custom category base is far from the only decision you need to make regarding category archive pages, however. You also need to decide how heavily you want to emphasise them in terms of SEO and whether to customize their content.

Tackling Category Archive Pages

There is a lot of hemming and hawing around the subject of category archive pages online, but it basically comes down to the following choice:

  1. You want to emphasize primary category pages: Take the trouble to customize their content, explicitly index the main page (but not subsequent archive pages), and allow links to be followed.
  2. You don’t want to emphasize primary category pages: Noindex and nofollow all archive pages.

What does that mean in practice? If you’re prepared to treat your primary category archive pages as essentially landing pages, you want to go for option one. Let’s say you have a category archive page at http://www.example.com/topics/restaurant-seo and you want that to be the primary page ranking for that topic on your site.

In this case, you’ll almost certainly want to customize the appearance of the archive page itself and make it compelling for users.

This could involve items such as adding additional text (for example the category description we looked at earlier), providing different templates for different categories, and displaying excerpts rather than full posts. You can find an excellent introduction to all these topics and more at the Codex Category Template page.

You’ll also want to control how search engines actually treat that page. In this example, you want to make sure that the initial page at /topics/restaurant-seo is indexed and all links followed. You also want to be sure that subsequent pages (e.g. topics/restaurant-seo/2) are not indexed.

This gives you the best of both worlds: users are free to browse as they wish while search engines are encouraged to highlight the specific content you want them to.

Any decent SEO plugin such as All in One SEO Pack (or our very own SmartCrawl) should give you plenty of options for controlling noindex and nofollow options, along with fine-grained control over sitemap generation.

If you don’t want to devote extra attention to your category archive pages, simply noindex and nofollow them completely and enable your primary content to attract search engine traffic on its own.

Managing Your Tags

The first point to emphasize regarding tags is that you are under no obligation to use them at all on any individual post. The primary factor governing their use should be how much value you think they’re bringing to site visitors, rather than any attempts to game search engines.

Use the following set of guidelines when adding tags to individual pieces of content:

  • Limit yourself to a maximum of five tags per post: A blizzard of tags is simply confusing for visitors. Consider each potential tag carefully in isolation and make sure it really refers to a specific, useful thing.
  • Don’t duplicate names in categories and tags: Take care not to cross the streams here in order to keep things simple for your users.
  • Keep tag names short: Aim for a maximum of three words.
  • Stay consistent with capitalization: As an example, tom ewer and Tom Ewer would create different tags. This is the sort of issue that quickly gets out of hand on larger sites so enforce conformity early.
  • Make sure tags are actually being used: A lone tagged item is very little use to anyone. Make sure there are at least three to five pieces of content that can be tagged before deploying.

As with categories, you can add tags on individual post pages and they can be managed directly in the back end by visiting Posts > Tags.

The tag management page is similar to that of categories.

As you can see in the image above, you’re looking at a very similar set of options for setting up tags to the ones we looked at before for categories.

When it comes to tag archive pages, we’re also looking at a similar set of concerns. A visit to the Codex Tag Templates page will point you in the right direction for customizing these templates if necessary. You should also use a plugin such as All in One SEO Pack to control indexing and following.

Wrapping Up

Categories and tags can be a little overwhelming when you first start diving into them, but their effective use really just boils down to common sense.

Make use of categories to impose broad structure on your topics and give users a clear idea of where they can find large swathes of related content. Use tags strategically to highlight specific commonalities across more diverse ranges of content.

When it comes to SEO concerns for either, don’t fall down the rabbit hole. Take a simple decision about how much you’re prepared to emphasise archive pages, and then tweak templates and make good use of meta tags to enforce consistency.

We'd love to hear how you're going about tackling tags and categories, and if there are any tips or tricks we've missed. Get in touch via the comments and share your thoughts.

Tags:

Hassan Akhtar Hassan Akhtar is the lead dev for Smush and HummingBird. In his free time he enjoys writing about his development adventures at WPGurus.net.