permalinks - Can two products with the same name but different category produce unique URLs?

admin2025-01-08  8

In the permalinks settings I have /courses/%product_cat%. Using WooCommerce I created two different Courses that are named "English", but they have different categories that end up making my urls look like this:

/
/

The Grade 12 URL is not ideal with the "-2" attached onto "physics". Is there anything I can do to remove that?

In the permalinks settings I have /courses/%product_cat%. Using WooCommerce I created two different Courses that are named "English", but they have different categories that end up making my urls look like this:

https://www.example.com/demo/chla/courses/grade-11/physics/
https://www.example.com/demo/chla/courses/grade-12/physics-2/

The Grade 12 URL is not ideal with the "-2" attached onto "physics". Is there anything I can do to remove that?

Share Improve this question edited Jun 3, 2019 at 15:16 leymannx 3,2213 gold badges29 silver badges35 bronze badges asked Jan 20, 2017 at 20:18 Darren BachanDarren Bachan 3752 gold badges7 silver badges17 bronze badges 3
  • "physics" must be unique because it is the post_name ('slug') and does not depend on any taxonomy. – Max Yudin Commented Jan 21, 2017 at 12:24
  • so my only option is to rename the slug? – Darren Bachan Commented Jan 21, 2017 at 22:26
  • I am also stuck in this. Did you get any solution? – Manoj Mohan Commented May 17, 2018 at 16:29
Add a comment  | 

1 Answer 1

Reset to default 0

You get this behavior as following:

  • Create a page as category name.
  • A product page, make it child of your category.
  • Use [product_page id="0"] to display a product.

You can now use the same product name in different categories.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736269466a1354.html

最新回复(0)