1

I'm building a website that allows you to hire or buy a product. I've set up the following product categories in WooCommerce:

  • Hire
  • Buy

Is it possible to have the same sub-category slug under each parent category? E.g.

  • Hire

    • Sub category
    • Sub category
  • Buy

    • Sub category
    • Sub category

When I try this, WordPress throws up the error message:

The slug “sub-category” is already in use by another term.

It's important to have duplicate sub-categories as the customer has the choice of buying or hiring a single item. I'd also need to do the same with the product slug E.g:

/buy/sub-category/product-name

/hire/sub-category/product-name

Currently I can only have:

/buy/sub-category/product-name

/hire/sub-category-2/product-name-2

  • did you manage to find a workaround? I'm also building a website on the same structure/idea and would love to hear how you went with the structure for this one, from both technical and SEO povs. – Madalin Feb 21 '17 at 9:54
  • Unfortunately not :( The client changed direction, so this method went out of the window. – Sam Feb 21 '17 at 16:21
2

Too bad no-ones answered you on this simple question. I guess you've allready figured it out, but for anyone else wondering the same:

A WooCommerce Slug is the true path to a certain category/product the database uses to find the correct category/product (just like on a computer: usr:\\My_Computer\Desktop\ or c:\\programfiles\desktop\), and can often be seen as a permalink in your browsers URL field (i.e.: http://yourshop.com/clothes/pants/).

This means that categories and products can have the same names, as long as the slugs are not the same (NB: within that category!) You can have:

/BUY/sub-category/product-name and /HIRE/sub-category/product-name but not: /BUY/sub-category/product-name and /BUY/sub-category/product-name

If you do not like the browser showing this, you can change your permalink settings, so that it looks like something like this: http://yourshop.com/?P=123 but bare in mind that search engines don't look as kindly on this.

0

Slugs refer to the URL that will be generated to get the data from wordpress database based on the criteria. In case if you put the duplicate Slug it is possible that the system may mess up and get confused on the data to be fetched.

So in your above case you can try naming it in different way eg.cat-subcat1, catsubcat-2 etc,

Your Answer

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

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