How to update the slug and change the WordPress permalink?

I have a problem with permalinks. In my site, I register the custom post type name ‘product‘ and taxonomy ‘type‘ . In taxonomy ‘type‘, I added terms like :

  • food
    • food A
    • food B
  • drink
    • drink A
    • drink B

With each product, I added one term, i.e. product1 in food A , etc.

Read More

The permalink is like this:

Product : http://abc.com/product/product1
Taxonomy : http://abc.com/type/food
           http://abc.com/type/food-a

But I want the permalink changed to this:

Product : http://abc.com/product-type/food/food-a/product1
Taxonomy : http://abc.com/product-type/food
           http://abc.com/product-type/food/food-a

I tried to configure .htaccess file but I can’t change anything. I found in WordPress Answers a solution is to change the “Rewrite” in register_taxonomy function but I can’t change anything again.

'rewrite'=>array('hierarchical' => true,'slug' => 'product-type')

I already added products, and now I can’t find any way to change the permalinks. I hope someone can help me to solve this problem.

Thanks

Related posts

Leave a Reply