Adding Categories and Subcategories to WordPress

After you’ve written a few posts you will probably want to organize them so that visitors have an easier time finding things. WordPress has two mechanisms for this — categories and tags. Today I’ll be discussing how to create categories.

Here’s my take on the whole Category vs. Tag debate: I think of categories as classes, while tags are attributes. For example, you might have “Horse”, “Cat”, and “Dog” categories, and “Brown”, “Spotted”, and “Fast” tags. Get it?

Back to the “how to” discussion.

The “formal” way

There are two different ways to create a category. The first is via the Dashboard menu:

CategoryMenu1

When you open up the category editor you see the following form:

CategoryForm

The name is what you want to be visible on your site. For example, you might want a Golden Retriever category, so you’d enter “Golden Retriever” in the Name field.

The “slug” is how it’s going to show up in links, so you might enter “golden-retriever” here. Note that only URL-friendly characters are allowed.

The description is just that - a description of the category. Some themes don’t make use of the description, but if they do you will probably find it on any category list pages.

The Parent field is the big part of what separates categories from tags. In this case you might have a Dog category that you would want to set as the parent of your new Golden Retriever category. Golden Retriever would become a subcategory of Dog. WordPress allows categories to go as deep as you want, but I haven’t seen any themes that will display them more than five levels deep.

The “informal” method

The “informal” method (which you will probably use the most) is as follows:

While editing a post look at the right side of the page and find the Categories box.

EditorCategory1

Click on the “Add New Category” link to open up a quick form.

EditorCategory2

Type the name of the category in the box, select a Parent Category (if this is a subcategory) and click on the button. Not only will your new category be automatically created but this post will be assigned to it. And your done! (At least as far as the category is concerned.) If you want to add a description or edit the slug you’ll have to use the Category Menu form.

By the way, categories and tags are exclusive to posts (not pages) so don’t go looking for the Categories box in the Page editor.

Have fun!