Complete Guide to Using WordPress Categories and Sub-Categories

WordPress has a taxonomy system that is beneficial in helping to separate content into different topics and areas on a website. With every WordPress installation comes categories and tags that can be used in different ways and will tie into the existing WordPress system perfectly. This also brings with it some significant differences between tags and categories that WordPress users need to understand more clearly.

Categories use a hierarchical taxonomy which can include a parent, a child and a sibling category. On the other hand, with tags they are non-hierarchical in their taxonomy which means that they do not have a parent or a child tag; tags can be applied singularly or as a collection of them on different posts.

Tags do not affect the structural appearance and layout of a given WordPress site whereas categories and sub-categories certainly can do. Categories need to be put together with considerable thought to both the future and how visitors will interact with them to find what they are looking for on the website. Slap together a collection of almost random categories and it will make more work for you later on.

Categories are intended to collect together a series of posts that are related in the subject matter in a general sense. On a recipes blog, recipes may be given categories like Vegetarian, Vegan, Breakfast, Dinner and Lunch. Whereas tags can delve into more specific topics while still keeping site organisation simple enough. For instance, with the same recipes blog, various posts can have tags added for lasagne, linguine, pot roast, steak, and other tasty items. These can be filed under different categories or sub-categories whilst still being tagged in different and useful ways.

It is important to understand the different taxonomies at work with WordPress between categories and tags. They are used in very different ways, to accomplish often separate goals and objectives, so it is beneficial to understand the differences before covering WordPress categories in more depth.

Categories and sub-categories can provide a level of control that WordPress would likely be lost without. It enables the publisher to organise content, sort it, manage it and display it in a structurally sound manner. Beyond just organising content into its own category, it also can help site visitors find their way around the site better which likely will increase their time on the site. Because categories have been supported for years in WordPress, there are many additional plugins that have been developed to further extend their capabilities.

This post delves much deeper into how to get the most out of categories and what plugins can extend how categories can be utilised inside WordPress.

Edit, Rename, or Merge Categories Together in WordPress

There is a considerable amount of confusion over the difference been categories and tags. Because of this, it is not uncommon for a web developer looking at a client’s site to discover tags used as categories and some categories that really should have only been tags. This can often result in some poorly-defined websites with some weird categories and strange tags that once set can stay with a website for years.

This situation rectifies itself after a while when users become more familiar with the inner workings of WordPress (hopefully!) but not usually until their early WordPress organisational efforts have become a bit of a jumbled mess.

When looking with a fresh eyes at the categories that exist on a website it can often be easy to see where one category can be simply merged into another and the category renamed in order to simplify matters.

Rather than try to meddle with the WordPress code, there is a plugin that can help with this. The Term Management Tools plugin once installed will let you easily merge one category with another. It will also create new categories too so that one or more tags can be merged into it, adding the new category and removing the offending tag. It is a very handy little tool for cleaning up the structure of content in WordPress.

Alternatively, the Categories to Tags Converter plugin can simply convert categories over to tags in a no fuss manner. This one will be more useful for users who have been confused over when a category should be tag and have subsequently created too many categories.

back to menu ↑

Jazz-up Categories with Their Own Icons

Being able to add a different graphical icon for each category is a nice touch. It identifies the category visually without the visitor needing to read the page title to confirm where they are.

This cannot be done natively within WordPress, but there is a handy plugin to help with this graphical enhancement. The icon can be shown on the page or even in a menu. The Simple Category Icons plugin lets you add icons or images to categories and other taxonomies within WordPress. It will also show up when categories are displayed or in the WordPress Dashboard.

It may be necessary to include a new template tag with the category archives template to get the graphic to show up. It will depend how customised the WordPress installation is, whether child themes are being used, and other considerations.

Alternatively, the Category Featured Images plugin offers some similar functionality which may appeal more to some users.

back to menu ↑

Let Users Subscribe to the Category RSS Feed

It is a little known fact that each category within WordPress creates its own self-updating RSS feed.

For example, take a look at the example below:

http://www.example.com/category/cars

The RSS feed for this category will be located here:

http://www.example.com/category/cars/feed

It is possible to add RSS icons in the templates for each category to let users access that particular feed in their RSS reader. This feed can be accessed virtually anywhere such as a subscription service for feeds (FeedPress) or in email services like GetResponse or AWeber.

back to menu ↑

Create Templates for Categories

The WordPress theme engine has more power under-the-hood than most users realise. With a little bit of digital artistry it is possible to create templates for particular categories rather than sticking with the standard one that looks the same for every category page.

WordPress works with the category.php template to manage the category archives within the content management system (CMS). Regardless of the category name, WordPress will use the exact same template to display the category appropriately. However, you can alter that so each category uses its own template to create a different look.

Simply copy over the main categories’ php coded template and then paste it directly into the child template you’ll be using. Now rename the child template to a different name, say categories-fruitilicious.php and the template can now be used for the fruit category.

Any number of alterations can be made to the customised Fruitilicious category page to distinguish it from the Vegetable page. Add a new category icon or an opt-in subscription page for a specific Fruit-themed newsletter or an RSS subscription to the RSS feed for the Fruiticious category.

Customisation can go so far as to put the top posts on a carousel or animated slider at the top of the category page to really distinguish it from other plain vanilla category pages.

back to menu ↑

Let Authors Be Responsible For Categories of Content

Do you operate a website with multiple writers, each one responsible for a certain category of content? If so, it is now possible to assign a given author to a category. This is achieved using the Author Category plugin.

The plugin can actually restrict one or more authors to certain categories. This way, authors can only add new posts for categories that they’ve been assigned to already. To use this feature, users will need to have the author user role set up. If a writer has either the Admin or Editor role assigned then this will override the features that this plugin offers.

back to menu ↑

Use Different Widgets On Category Pages To Individualise Them

Let’s talk about the sidebar widgets functionality inside WordPress. It is a bit limited to put it mildly. The same widgets will display on every page on a site once they’ve been added on the Widgets page. There are a few things that can be done about that to display different widgets on your custom category pages.

Add the Widget Logic plugin first of all. This WP plugin does wonders for widget control by letting you decide which widgets will be displayed on which pages. A series of conditions can be set to control which widgets are shown on which pages without the need to manually edit the widget display configuration page by page (on a large site that can get tiresome quickly!). Widgets can also be simply set to show or hide on individual pages too.

Controlling widgets on custom category pages is a nice touch, but the same plugin features can be utilised throughout the website to give it far more custom look and feel. This means that the “Contact Us” page can have a Google Maps widget shown just on that page, for instance. Handy.

back to menu ↑

Show Single Category Content on a Regular Page

It is always a useful feature to be able to pull up posts in a certain category and display them on other pages. This is not something that can be achieved with the basic WordPress install.

The List Category Posts plugin makes it possible to pick a category (or several categories) and then display a list of recent posts in that category.

A Shortcode is added to any web page or post which can then insert the information that the WordPress plugin provides. The settings for the plugin include the ability to set how many items to show in the list that gets displayed. Post titles can be shown, the author name, an excerpt from the post, or even the whole post can be added within the content. This is essentially content within content which is impossible to do with WordPress otherwise.

There is good support for this plugin with a forum and other resources with people sharing how they’ve used it in a surprising number of creative ways.

back to menu ↑

Use Excerpts Instead of Complete Content on Category Archives

The category archives can look a bit too “busy” when displaying the full content on the page, not to mention the page load times get extended. This can increase the bounce rate experienced for category archive pages. There is an easy fix for this that doesn’t require a plugin to do so.

Open up your category archive templates and replace:

<?php the_content(); ?>

With this alternative code:

<?php the_excerpt(); ?>

Making this change is not only useful for users, it is also helpful for search engine optimisation. Search engines can sometimes mistakenly believe that the full content shown on the category page is more authoritative than the original post is. This leads to a lower ranking of the main posted content on the site which is not desirable. By only showing excerpts on the category archive pages this avoids (or corrects) this situation.

back to menu ↑

Use a Better Recent Posts Widget For Categories & Tags

The Recent Posts Widget Extended plugin is a great way to pull out posts from different categories and group them together in a sidebar on the page.

Categories of content can be put on show to help highlight content. Multiple categories can be selected, and tags can also be included to ensure nothing important is missed out from the list.

Control whether post titles, post excepts, thumbnails, publication date, and other information should be included with each item in the list. Both HTML and CSS can be customised to give the post list a different look to other widgets.

back to menu ↑

Give WordPress Pages The Categories They Are Sorely Missing

WordPress pages do not come with categories and tags. This is unfortunate but it makes sense because posts are supposed to be for blogs whereas pages are more connected to the structure of the overall website.

The pages used within WordPress have an order then nests with parent and then child pages beneath. With that said, the users of WordPress has evolved so much that non-blog websites are often created which do not even include any blog posts at all. Some examples would be a real estate website with property listings or a yacht leasing company which shows different floating real estate that can be rented out over a short or long period of time.

When using pages in a way that is similar to how posts used to be organised, it becomes useful to have the ability to put pages into different categories as well and add a sprinkling of tags here and there. This can done using the Post Tags and Categories plugin which thoughtfully adds this capability for sites that need it.

back to menu ↑

Create Sticky WP Posts Just Like Sticky Forum Posts

Have you seen those sticky forum posts that sit at the top of a message board and don’t move? Wouldn’t it be nice to be able to take a post in a certain category and make that post sticky so it sits at the top of the individual category?

The Category Sticky Post plugin makes it possible to do just that. Display a list of posts from that category and the selected post using this plugin will conveniently sit proudly at the top of the list.

The plugins lets you also add some minor formatting to the sticky post so that it will stand out more from the other posts below it. This is a nice touch for users who do not wish to go into the underlying code to jazz up the look of the sticky post manually.

back to menu ↑

Export All Posts From a Given Category

WordPress has useful tools to export a WordPress site by placing content into XML files for transit and reintegration into a new blog. This will usually include all posts in all categories rather than being able to be specific about which categories to export and which ones to exclude.

There is a useful way that exports only content from specific categories.

Go over to Tools, then select Export, and click on Posts.

WordPress with then display the export options area. From there, it is possible to choose the author, the category, and also a data range of posts from the start date to a finish date. Posts can also be selected by their status. Clicking on the “Download Export File” will generate an XML file in the correct export format that another WordPress installation can readily interpret.

Unfortunately, the export feature is currently limited to a single category at a time. This means for sites with many categories, the exporting process could take quite a while as it has to be run through for every category needed to be exported.

back to menu ↑

Decide Which Categories Be Included On Main Page, Feeds, Archive & Search Pages

Using the Ultimate Category Excluder plugin it is possible to choose which categories can be included on the home page, category page and other archive pages, RSS feeds, and the page which displays search results

The plugin displays as a grid with the current categories shown down the left side and the choices of “Exclude from Main Page”, “Exclude from Feeds”, “Exclude from Archives”, and “Exclude from Search” shown in columns at the top. You can then tick the check boxes in each column and row to indicate which category of posts should be excluded from one or more of these specific areas of the WordPress site.

This new feature could be useful when creating new posts that are best displayed in their own category. Such posts would not benefit being shown on the homepage because of the niche nature of the subject matter which only appeals to a small sub-set of the readers arriving via the home page. Other content like product reviews may be better only shown in appropriate areas so as not to make the site look too commercial.

back to menu ↑

Force The Selection Of Only One Category At A Time

Do you ever want to ensure that posts on a website can never be given more than one category? If you have created very specific and separately defined categories then there is certainly a place to restrict access to assign more than one category per post. Often a tag would be a better choice when categories are sufficiently individualised to offer no overlap potential.

The Only One Category plugin amends the sidebar for a new post so that radio buttons are displayed rather than check boxes. This ensures that only a single category can be selected per post rather than multiple categories.

back to menu ↑

Setting The Default Category Per User

Rather than using a more advanced plugin to provide improved author controls, the Default Category plugin is pretty simple and easy to set up.

When a particular author is only expected to publish on a specific category (but they can choose to publish under different categories too) this plugin can help set a default category for posting by each author. This can avoid a wrong selection for each post by providing a useful author-specific default. This however does not prevent them from choosing a different category for those times when they write on a different subject.

back to menu ↑

Conclusion

Categories are extremely powerful tools within WordPress when used properly. This is really the key thing here. Most often new WordPress users will get confused between when to use a category and when to use a tag. This leads to a messy situation with new websites that become a miss-match of confusing categorisation and odd tagging.

The plugins and code changes recommended above can help fix such mistakes after they happen and provide extended capabilities to the lowly category to enhance how they can be used in WordPress.

Make best use of WordPress categories in order to help site visitors find new and older content quickly, stay on the site longer, and interact with other visitors.

No Comments

Leave a reply