{"id":151316,"date":"2016-01-20T11:00:14","date_gmt":"2016-01-20T16:00:14","guid":{"rendered":"http:\/\/premium.wpmudev.org\/blog\/?p=151316"},"modified":"2016-01-20T07:14:46","modified_gmt":"2016-01-20T12:14:46","slug":"using-categories-tags","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/using-categories-tags\/","title":{"rendered":"Using Categories and Tags Effectively in WordPress"},"content":{"rendered":"<p>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.<\/p>\n<p>There&#8217;s been a lot of debate\u00a0about their respective merits over the years and even experienced users often waste an unnecessary amount of time agonizing over unnecessary minutiae \u2013 particularly when it comes to the subject of SEO.<\/p>\n<p>In this article, we&#8217;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.<\/p>\n<h2>An Overview of Category and Tag Basics<\/h2>\n<p>Categories were originally the only taxonomy option available to users\u00a0and\u00a0tags were introduced into the mix in <a href=\"https:\/\/codex.wordpress.org\/Version_2.3\" rel=\"noopener\" target=\"_blank\">WordPress 2.3;<\/a>\u00a0you&#8217;ve doubtless come across their handy interfaces on hundreds of post pages in the back end ever since.<\/p>\n<div  class=\"wpdui-pic-regular  \">\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735 size-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2016\/01\/add-categories-tags.png\" alt=\"Adding categories and tags on a post page.\" width=\"734\" height=\"546\" \/><figcaption class=\"wp-caption-text\">Adding categories and tags on a post page.<\/figcaption><\/figure>\n<\/div>\n<p>Before we get into each option in detail, here&#8217;s a review of the basics:<\/p>\n<ul>\n<li><strong>Location:<\/strong>\u00a0By default, both categories and tags can only be used on posts, not pages<\/li>\n<li><strong>Use:<\/strong> Every post needs to have at least one category, whereas tags are entirely optional<\/li>\n<li><strong>Hierarchy:<\/strong>\u00a0Categories can be placed into hierarchies with multiple levels of sub-categorization whereas the structure of tags is entirely flat<\/li>\n<\/ul>\n<p>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.<\/p>\n<p>To take a specific example, if you&#8217;re running a site about cookery, you might use categories to group cuisines from the same region together with headings for <em>Italian<\/em>, <em>French<\/em>, <em>Indian<\/em> etc. You&#8217;d also have the option of drilling down further with sub-categories\/child categories if you wanted.<\/p>\n<p>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 <em>tomato<\/em> tag, for example, would return tomato-based recipes from around the world.<\/p>\n<h2>Setting Up Categories<\/h2>\n<p>Before you dive into creating categories, it&#8217;s worth spending some time thinking about structure upfront.<\/p>\n<p>Your category list will naturally expand over time \u2013 and sub-categories may well eventually be necessary \u2013 but you want to keep things relatively tight here. Again, think of this in terms of book chapters to begin with. If you&#8217;re finding yourself with initial lists of over 15 categories, it could be time for a re-think.<\/p>\n<p>While you&#8217;re free to add new categories from individual posts, the main category interface is found at <em><a href=\"https:\/\/codex.wordpress.org\/Posts_Categories_SubPanel\" rel=\"noopener\" target=\"_blank\">Posts &gt; Categories<\/a><\/em>. As you can see from the image below, this displays lists of current categories with use counts for easy management\u00a0and gives you a quick way of adding new ones.<\/p>\n<div  class=\"wpdui-pic-regular  \">\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735 size-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2016\/01\/categories-screen.png\" alt=\"The main WordPress category management page.\" width=\"735\" height=\"704\" \/><figcaption class=\"wp-caption-text\">The main WordPress category management page.<\/figcaption><\/figure>\n<\/div>\n<p>Let&#8217;s briefly step through the options shown above for creating a category:<\/p>\n<ul>\n<li><strong>Name:<\/strong> This is what you&#8217;ll see listed on the front-end depending on how your theme is set up. Go for obvious names that will both\u00a0<a href=\"https:\/\/www.nngroup.com\/articles\/category-names-suck\/\" rel=\"noopener\" target=\"_blank\">make instant sense<\/a> 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.<\/li>\n<li><strong>Slug:<\/strong> This is the URL-friendly version of your name which will appear in both category archives and post URLs if you&#8217;re using custom permalinks \u2013 we&#8217;ll cover both these scenarios in detail later. For now, remember to use dashes to separate words, omit stop words, and avoid keyword stuffing.<\/li>\n<li><strong>Parent:<\/strong> Use this to assign an item as a sub-category or leave at <em>None<\/em> to make it a top-level category.<\/li>\n<li><strong>Description:<\/strong> Whether this is actually used anywhere depends on your theme and whether you are explicitly calling it.<\/li>\n<\/ul>\n<p>Each post can be assigned to more than one category but, again, you want to keep things straightforward here to avoid potentially baffling users.<\/p>\n<p>Try to keep the number of categories a post is filed under to a maximum of two \u2013 one is ideal. If you need to highlight extra bits of information that can be found elsewhere on your site, you&#8217;ve always got the option of using tags.<\/p>\n<p>Depending on the nature of your site, you might find the default option of <em>Uncategorized<\/em> less than useful and wish to assign a different one such as <em>General Thoughts,<\/em> for example. If that&#8217;s the case, simply edit the details via the main <strong>Categories<\/strong> page and you&#8217;re good to go.<\/p>\n<h2>Categories and Permalinks<\/h2>\n<p>As we covered in the recent <a href=\"https:\/\/wpmudev.com\/blog\/wordpress-permalinks\/\" target=\"_blank\" rel=\"noopener\">guide to permalinks<\/a> here on the blog, you&#8217;ve also got the option of including categories in your URLs by using custom permalinks.<\/p>\n<p>To do this, you&#8217;ll need to visit <strong>Settings &gt; Permalinks<\/strong> and use the <code>%category%<\/code> <a href=\"https:\/\/codex.wordpress.org\/Using_Permalinks#Structure_Tags\" rel=\"noopener\" target=\"_blank\">structure tag<\/a> as part of your Custom Structure. Here&#8217;s an example:<\/p>\n<div  class=\"wpdui-pic-regular  \">\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735 size-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2016\/01\/category-permalinks.png\" alt=\"Using categories in permalinks.\" width=\"735\" height=\"467\" \/><figcaption class=\"wp-caption-text\">Using categories in permalinks.<\/figcaption><\/figure>\n<\/div>\n<p>In the example above, we&#8217;ve taken the decision to go with <strong>category\/postname<\/strong> as the custom URL structure, so a post with the slug <strong>my-music-post<\/strong> and a category slug of <strong>classical<\/strong> would show up as pictured below:<\/p>\n<div  class=\"wpdui-pic-regular  \"> <img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735 size-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2016\/01\/classical-music-category.png\" alt=\"Classical music category example.\" width=\"735\" height=\"67\" \/> <\/div>\n<p>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.<\/p>\n<p>While you&#8217;ll see arguments pushing the merits of using categories in permalinks for SEO purposes online, it&#8217;s by no means a decisive factor. Consider it primarily in terms of value to your users rather than potential payoffs for search engines.<\/p>\n<p>A quick browse through the voluminous <a href=\"https:\/\/wpmudev.com\/blog\/\" target=\"_blank\" rel=\"noopener\">WPMU DEV blog archives<\/a> 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).<\/p>\n<div  class=\"wpdui-pic-regular  \">\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735 size-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2016\/01\/wpmu-dev-category-example.png\" alt=\"WPMU DEV category example.\" width=\"735\" height=\"415\" \/><figcaption class=\"wp-caption-text\">Categories being highlighted on WPMU DEV.<\/figcaption><\/figure>\n<\/div>\n<h2>Setting a Custom Category Base<\/h2>\n<p>If you followed along by visiting <strong>Settings &gt; Permalinks<\/strong> in the previous section, you&#8217;ll have noticed another setting marked as <strong>Optional<\/strong> for controlling what&#8217;s referred to as your category base.<\/p>\n<div  class=\"wpdui-pic-regular  \">\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735 size-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2016\/01\/optional-category-base.png\" alt=\"Optional category base screen.\" width=\"735\" height=\"227\" \/><figcaption class=\"wp-caption-text\">Optional category base screen.<\/figcaption><\/figure>\n<\/div>\n<p>This gives you the ability to change what comes before individual category names in your category archive pages. In the example below, I&#8217;ve changed the category base to <strong>music<\/strong> which you can see appearing in the <strong>Classical<\/strong> category&#8217;s archive page URL.<\/p>\n<div  class=\"wpdui-pic-regular  \"> <img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735 size-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2016\/01\/permalink-example.png\" alt=\"Permalink example.\" width=\"735\" height=\"66\" \/> <\/div>\n<p>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.<\/p>\n<h2>Tackling Category Archive Pages<\/h2>\n<p>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:<\/p>\n<ol>\n<li><strong>You want to emphasize primary category pages:<\/strong> Take the trouble to customize their content, explicitly index the main page (but not subsequent archive pages), and allow links to be followed.<\/li>\n<li><strong>You don&#8217;t want to emphasize primary category pages:<\/strong> Noindex and nofollow all archive pages.<\/li>\n<\/ol>\n<p>What does that mean in practice? If you&#8217;re prepared to treat your primary category archive pages as essentially landing pages, you want to go for option one. Let&#8217;s say you have a category archive page at <strong>http:\/\/www.example.com\/topics\/restaurant-seo<\/strong> and you want that to be the primary page ranking for that topic on your site.<\/p>\n<p>In this case, you&#8217;ll almost certainly want to customize the appearance of the archive page itself and make it compelling for users.<\/p>\n<p>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 <a href=\"https:\/\/codex.wordpress.org\/Category_Templates\" rel=\"noopener\" target=\"_blank\">Codex Category Template<\/a> page.<\/p>\n<p>You&#8217;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 <strong>\/topics\/restaurant-seo<\/strong> is indexed and all links followed. You also want to be sure that subsequent pages (e.g. <strong>topics\/restaurant-seo\/2<\/strong>) are not indexed.<\/p>\n<p>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.<\/p>\n<p>Any decent SEO plugin such as <a href=\"https:\/\/wordpress.org\/plugins\/all-in-one-seo-pack\/\" rel=\"noopener\" target=\"_blank\">All in One SEO Pack<\/a> (or our very own <a href=\"https:\/\/wordpress.org\/plugins\/smartcrawl-seo\/\" rel=\"noopener\" target=\"_blank\">SmartCrawl<\/a>) should give you plenty of options for controlling noindex and nofollow options, along with fine-grained control over sitemap generation.<\/p>\n<p>If you don&#8217;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.<\/p>\n<h2>Managing Your Tags<\/h2>\n<p>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&#8217;re bringing to site visitors, rather than any attempts to game search engines.<\/p>\n<p>Use the following set of guidelines when adding tags to individual pieces of content:<\/p>\n<ul>\n<li><strong>Limit yourself to a maximum of five tags per post:<\/strong> 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.<\/li>\n<li><strong>Don&#8217;t duplicate names in categories and tags:<\/strong> Take care not to cross the streams here in order to keep things simple for your users.<\/li>\n<li><strong>Keep tag names short:<\/strong> Aim for a maximum of three words.<\/li>\n<li><strong>Stay consistent with capitalization:<\/strong> As an example, <em>tom ewer<\/em> and <em>Tom Ewer<\/em>\u00a0would create different tags. This is the sort of issue that quickly gets out of hand on larger sites so enforce conformity early.<\/li>\n<li><strong>Make sure tags are actually being used:<\/strong> 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.<\/li>\n<\/ul>\n<p>As with categories, you can add tags on individual post pages and they can be managed directly in the back end by visiting <strong>Posts &gt; Tags<\/strong>.<\/p>\n<div  class=\"wpdui-pic-regular  \"> <img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735 size-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2016\/01\/tag-page-example.png\" alt=\"The tag management page is similar to that of categories.\" width=\"652\" height=\"735\" \/> <\/div>\n<p>As you can see in the image above, you&#8217;re looking at a very similar set of options for setting up tags to the ones we looked at before for categories.<\/p>\n<p>When it comes to tag archive pages, we&#8217;re also looking at a similar set of concerns. A visit to the <a href=\"https:\/\/codex.wordpress.org\/Tag_Templates\" rel=\"noopener\" target=\"_blank\">Codex Tag Templates page<\/a>\u00a0will 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.<\/p>\n<h2>Wrapping Up<\/h2>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>When it comes to SEO concerns for either, don&#8217;t fall down the rabbit hole. Take a simple decision about how much you&#8217;re prepared to emphasise archive pages, and then tweak templates and make good use of meta tags to enforce consistency.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tags and categories are core WordPress concepts but how to use them most effectively is often a source of confusion. Here&#8217;s a common sense approach to both that gives you practical guidelines for setting them up properly on your live sites.<\/p>\n","protected":false},"author":37930,"featured_media":151379,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[152,45],"tutorials_categories":[],"class_list":["post-151316","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-categories","tag-tags"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/151316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/37930"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=151316"}],"version-history":[{"count":11,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/151316\/revisions"}],"predecessor-version":[{"id":203622,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/151316\/revisions\/203622"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/151379"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=151316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=151316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=151316"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=151316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}