Right now WordPress forces unique slugs in a couple different ways.
- Unique key in the database for the slug
- wp_unique_term_slug function which changes the slug if wordpress finds a duplicate
For my projects it doesn't make much sense to make all slugs unique when they have different parents. Right now the structure of the url gets bodged and looks very ugly.
Example with hierarchial taxonomy: businesses
We have the parent terms, these represent businesses pillars of which the company provides all kinds of products and services. We want to put these in a hierarchial taxonomy tree for sorting like so:
Right now WordPress doesn't allow for multiple products and systems. Obviously we might want to find all products (cross parent) but the url: businesses/shipping/products could (and should) provide different results than businesses/aviation/products
In this scenario duplicate slugs are not a problem because in their own scope they are unique.
My proposal is expanding the unique function and check if the taxonomy is hierarchial and if so then only check if there are no duplicate slugs on that same scope/level. Also remove the unique identifier from the database collumn.
So in short. Hierarchial should be more hierarchial in the essence of the word.