This is the desired output:

a.) for taxonomy term = /post-type-slug/taxonomy-term-slug/

b.) for post single = /post-type-slug/taxonomy-term-slug/post-name/

The problem is only one of these setup work at a time. If I setup the post single permalink first, taxonomy term permalink would go to 404, and vice versa.

say for example I want this permalink structure: /products/category-name/product-name/

  • products = post type rewrite slug
  • category-name = taxonomy term slug
  • product-name = post single name

I am using the plugin Custom Post Type UI to create the custom post type and taxonomy.

Setup for custom post type:

  • Post Type Slug = product
  • Has Archive = True
  • Archive Slug = products
  • Custom Rewrite Slug = products

Setup for taxonomy:

  • Taxonomy Slug = product_cat
  • Hierarchical = True
  • Rewrite = True
  • Custom Rewrite Slug = products

Again, only one of the setup works, either the post type single or the taxonomy term. I believe this is because the rewrite rules are already set for the first one created.

Workaround I tried to achieve this permalink structure is to just setup the custom post type as hierarchical and create the post parent as category, but I don't think this is pretty setup.

Is there another way to achieve this?

Is there another way to achieve this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.