WordPress.org

Ready to get started?Download WordPress

Ideas

Hierarchial taxonomy terms should not be unique on different parents

  1. Hoppinger
    Member

    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:

    Aviation
    - products
    - systems
    - training

    Shipping
    - products
    - systems
    - consultancy

    Train
    - products
    - systems

    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.

    Posted: 2 years ago #
  2. Henry
    Member

    12345

    WordPress does not allow the same term to be used under different parent terms.

    Be great if it did. This idea gets my vote.

    Posted: 1 year ago #
  3. frinkky
    Member

    12345

    Thumbs up on this. Arrived here whilst googling a solution to just this problem.

    Posted: 1 year ago #
  4. landwire
    Member

    12345

    +1

    Has this been looked at/changed since this was posted? Definitely something I would be hoping for too. Makes much more sense.

    Posted: 6 months ago #
  5. landwire
    Member

    12345

    Just seen that this is a duplicate of another idea. BUT where is the reference to the original idea??? Just so I can check if this has/will be implemented.
    Thanks
    Sascha

    Posted: 6 months ago #
  6. Ipstenu (Mika Epstein)
    Administrator

    FWIW here's the trac ticket about it: https://core.trac.wordpress.org/ticket/5809

    Posted: 6 months ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    14 Votes
  • Status

    Duplicate of another idea