[wp-trac] [WordPress Trac] #42248: Can't create category slug with same name for different parents
WordPress Trac
noreply at wordpress.org
Tue Jul 8 10:17:33 UTC 2025
#42248: Can't create category slug with same name for different parents
-------------------------------------------------+-------------------------
Reporter: ashokrd2013 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: Permalinks | Version: 4.9
Severity: normal | Resolution:
Keywords: has-screenshots dev-feedback needs- | Focuses:
patch | administration
-------------------------------------------------+-------------------------
Comment (by callumbw95):
Hi @ashokrd2013,
I have taken a look into this and can confirm that this issue is happening
still in the latest version. However because categories can be moved from
one parent to another or even moved to have no parent this could
potentially cause issues in the future. However in your example I wonder
if there is a way around this by organising your categories in a different
way? For example:
- /cars/toyota
- /cars/maruti
- /cars/parts
Then associating your posts under both the relevant manufacturer and the
parts category, most likely setting the default category as the
manufacturer. This would keep the slugs separate but also allow you to
filter correctly for each as under the parts category you could filter
them by the manufacturer. Then under the manufacturer you could filter
them by parts or otherwise.
Also as I feel like this is potentially related to WooCommerce, I would be
tempted to move the manufacturer to the brand attribute on the products so
instead of the more general category you make use of the various product
taxonomies available to achieve this without creating duplicate slugs.
However I may be going a bit off-piste here, so if you have any more
context to add that would be much appreciated. 😃
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42248#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list