We’ve all done it. Using categories as a pseudo site structure in WordPress is an easy way to group and display posts as if they were in different sections. It works, but let’s face it, it’s a hack and it can lead to some headaches as your site grows. Keep reading to learn why you should never use categories for grouping posts in WordPress (plus an alternative solution).
Posts can have multiple categories
When using categories to mimic a site structure, a post will be listed in multiple “sections” on your site. This is great when users want to view content by category or tag, but not when they’re browsing the content in a section. Posts should belong to a single section in the site’s structure.
Though it’s not recommended for performance reasons, post permalinks can be set to use the post’s category in the permalink so you can complete the illusion of a true site structure by having post URIs like
mysite.com/category-name/post-name/. As mentioned above though, posts can have multiple categories, and you have no control over which category is used in a post’s permalink. This means that a post listed in the News “section” could have a URI like
mysite.com/thoughts/sample-post/ (if the post is in both the “News” and “Thoughts” categories). You don’t need to be Spock to know that this is highly illogical. Post URIs should describe the post’s position in the site structure.
A post’s URI should tell users what the post’s relationship with the rest of the site is. For example, a URI such as
mysite.com/news/sample-post/ would indicate that the post is in the News section. However, if categories are used in the permalink, the user will only know ONE of the categories that the post is in. This will not help the user to better understand or visualize the structure of the site as a whole. Furthermore, to avoid conflicts with page names, URIs for category archive pages need to be prefixed with a category base, so while a post URI may look like:
The “section” listing this post will have a URI like:
While there is some similarity between the post URI and it’s parent “section,” it is not strong enough for users to see an obvious relationship between section and post URIs.
Cannot use categories as categories
Categories and tags are meant to organize posts into loosely-related groups. A post can be group with one set of posts in one category, while it can be grouped with another group of posts in another category. This is a powerful way to show relationships between content across the entire site. However, when categories are used as “sections,” you can no longer use them as amorphous groupings as you’ll likely want to restrict the number of categories you assign to a single post to avoid the aforementioned issues.
Yes, you still have tags for loose groupings, but what if you wanted to use both categories and tags on your site?
Pages create a true site structure
Using categories to create the illusion of a site structure is a hack at best, and damaging to your site at worst. Pages, on the other hand, create a true site structure based on their hierarchy. Page URIs don’t require any prefixed segments and thus can be located at the root of the site if desired (e.g.
mysite.com/news/). This allows you to accurately recreate a site structure just like one made out of actual files and directories.
In addition to structure, pages can include additional content that categories cannot such as rich text content, custom metadata, media attachments (photos, videos, images, etc.).
Though it is a common practice, I don’t think anyone likes using categories for creating pseudo site structures. With no other options, it’s a necessary evil for a site requirement that is becoming more and more common (displaying posts in sections). Cornerstone is a WordPress plugin that presents a solution that doesn’t require compromises on performance or flexibility when building a site’s structure. Check out Cornerstone and see what it can do for you!