WordPress.org

Ready to get started?Download WordPress

Ideas

Allow duplicate sub terms in custom taxonomies

  1. Henry
    Member

    12345

    If I set up a custom taxonomy called Fashion and set up a top level term and some second level terms I get:

    Top level term: Men
    Second level terms: Bags, Shirts, Trousers
    URL: example.com/base/men/bags

    However, when I create a new top level term (let us say 'Women') and some second level terms - one of which is identical to a second level term I have already set up under 'Men' I get a slightly different URL

    example.com/base/women/bags-women

    As you can see if you have duplicate second-level terms in a custom taxonomy WordPress doesn't like it very much and modifies the slug so that that second-level term is unique.

    It would be great to be able to have both

    example.com/base/men/bags

    and

    example.com/base/women/bags

    Posted: 1 year ago #
  2. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod

    It has to do with the possibility of you moving the bags from women to men. If they both have the slug 'bags' then WP has no way of knowing which one you meant, so they must be unique.

    Posted: 1 year ago #
  3. Henry
    Member

    12345

    Hi Mika,

    The 'possibility' of someone moving a sibling term to a different parent is stopping WordPress from having great URLs.

    If someone decides to move a sibling term to a different parent (which already has a sibling term with the exact same slug as the sibling that is being moved) then surely a prompt to rename the sibling can be put in place?

    Posted: 1 year ago #
  4. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod

    They still have to have unique slugs, though. So no, a simple rename won't be the solution :(

    That said, you shouldn't be using categories and tags for 'great urls' anyway. The great URL is for your post, which shouldn't have either term in it's normal slug.

    Posted: 1 year ago #
  5. Henry
    Member

    12345

    WordPress is now considered much more than a simple blogging tool (categories, tags and post slugs). I'm not talking so much about these.

    The idea is directed more towards WordPress as a CMS, especially if taking advantage of custom post types and taxonomies.

    Imagine a site with URLs like this:

    example.com/base/men/accessories-men
    example.com/base/men/swimwear-men
    example.com/base/women/accessories-women
    example.com/base/women/swimwear-women

    Then imagine a site with URLs like this:

    example.com/base/men/accessories
    example.com/base/men/swimwear
    example.com/base/women/accessories
    example.com/base/women/swimwear

    The URLs in the second example are so much cleaner and much more appealing for any website using WordPress as a CMS.

    Posted: 1 year ago #
  6. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod

    Unless these are all the same posts, I would be using Custom PostTypes for that and not categories or tags.

    Posted: 1 year ago #
  7. serpyre
    Member

    There is a plugin "Duplicate Category Paths" that does this for all taxonomies including categories, WooCommerce product categories, etc. for 3.x. It removes the base if necessary so that it is a clean url.

    domain.com/womenswear/clothing/jeans
    domain.com/menswear/clothing/jeans

    Posted: 11 months ago #
  8. bigj9901
    Member

    I have seen you mention the Duplicate Category Paths plugin in other posts but have not been able to find it. Link?

    Posted: 9 months ago #
  9. serpyre
    Member

    If you search "Duplicate Category Paths" with the quotes you will find it in Google.

    Posted: 9 months ago #
  10. bigj9901
    Member

    I found it but the page doesn't say anything about how it works. Can you provide any insight?

    Posted: 9 months ago #

RSS feed for this topic

Reply »

You must log in to post.

  • Rating

    12345
    1 Vote
  • Status

    Duplicate of another idea