DNExpert.com - domain name news & opinions!
Have domain industry news? Contact us!

Hello & welcome!

How To Show Subcategories In Permalink

Obviously, when setting up a new blog with WordPress, one of the first things you will do is change the permalink structure as by default “WordPress uses web URLs which have question marks and lots of numbers in them”.

Although dnxpert runs of the “date/postname” structure, a number of other sites I run function with the “category/postname” permalink structure.

Recently I built a WordPress silo site which had a number of categories and subcategories – it was a recipe site with category recipes and subcategories soups, desserts etc. I wanted each post to show its specific subcategory in the url. For example, I wanted to show fruit cake with the following permalink structure: “mysite.com/recipes/desserts/fruit-cake”

How did I get subcategories to show in permalinks?

It is actually quite obvious and simple yet I never realized this before. When you assign a post to a subcategory, simply don’t also assign it to the parent of that subcategory. In my case, I assigned the fruit cake post to desserts and not to recipes and hey presto, I had a permalink structure that I wanted.

7 comments

  1. I just figured this out, which led me to your post. This effectively works on normals posts, but doesn’t in the case of a custom post type. Just thought i’d share …

  2. This tip is really amazing. I have been looking for wp post permalink with subcategory on several blogs, but your great tip make me clear. Thanks for your helpful post. You’re Rock, Man!

  3. Wow, thanks a LOT.. Making the Subcategory and category in a wordpress permalink was exactly what I was looking for. After many minutes of searching google I finally happened upon this page.. Thanks again friend

Leave a Reply