I have a Custom Post type "Data" with a custom Taxonomy "data-category".

Currently my site url when I visit a 'data-category' shows like this :


Here Home-Loan is a child of Personal Loan data-category.

I need my url to show like this :


Yes I need to get rid of 'data-category' from my url.



1 Answer 1


Found the solution. By default wordpress doesn't show hierarchical URL for custom taxonomies.

Therefore while registering custom taxonomy, we must include the rewrite variable.

 $args = array(

        'rewrite'           => array( 'hierarchical' => true ),

  • Still One problem remains though. I can't have same slug for different category childs. www.mysite.com/Personal/home-loan www.mysite.com/leasing/home-loan It is not possible as 'home-loan' slug can't be use twice. Looking to resolve it. Commented May 12, 2014 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.