How to Include Category and Subcategory in WordPress URLs

One of the best thing about the WordPress is that it handles so many things that otherwise would have taken lot of your time.

I wanted to write about various places. As you know places are hierarchical i.e. we have many countries, Each country has multiple states, each state has districts and each district has cities and towns and towns have the places to see.

I wanted to have url as below


Go to settings–>permalinks and use “/%category%/%postname%/” (without double quotes)


When you write post, make sure you select only the child category

To make sure categories are in required hierarchical order go to


If you select all categories like India, Maharashtra and Pune, it will show url with only base category, so it is important that you select only one category, the one which is needed to be displayed in url



Leave a Reply

Your email address will not be published. Required fields are marked *