WordPress.org

Ready to get started?Download WordPress

Forums

Bug: Cannot have duplicate category and tag slugs (17 posts)

  1. Isobel
    Member
    Posted 5 years ago #

    When you try to create a category and there is an existing tag with the same slug, 2.7.1 onwards rewrites the category slug to child-slug-parent-slug or adds a digit to the slug. It started with 2.7.1 but updating from earlier versions keeps the existing category slugs even if the tag slug exists; it won't however let you create new ones that duplicate tag slugs.

    e.g. if tag doesn't exist:
    Parent category: Make Money, slug make-money
    Child category: Internet Marketing, slug internet-marketing - which is correct and expected.

    However if tag internet-marketing already exists, child category gets rewritten as internet-marketing-make-money

    My workaround is to create the categories first as I want them, and then the tag slugs using a _ in place of a hyphen for the tags, e.g. category internet-marketing, tag internet_marketing. This however is not acceptable as the standard format for tags uses a hyphen.

  2. lee.jordan
    Member
    Posted 4 years ago #

    I'm having the same problem.

    It seems even if you use parent categories ie are building a good structure or taxonomy you still can't have multiple duplicate children, even if the children are from "different parents" and that's a key point here, different parents. It's like saying there's only ever going to be one Tom one Dick and one Harry in the world EVER no more no less. Hardly flexible, when you look at the real world I know multiple Sarah's who've come from different parents and I can tell the difference between them fine :)

  3. tdishman
    Member
    Posted 4 years ago #

    This is an incredibly frustrating issue, particularly for someone just starting with WP and hoping to accomplish a simple taxonomy. As a developer myself, it seems unimaginable that I wouldn't be allowed to create a simple taxonomy such as:

    books/children
    toys/children

    I have to jump through hoops to have multiple categories named "Children". And then God forbid if I would want to have "children-books" as a tag slug when I've already had to use this slug for a category just to get in the ballpark of what I wanted to do.

    Very frustrating.

  4. You should be able to customize the slugs, to a degree, but having children categories does tend to goober it up a bit.

  5. GuruJi
    Member
    Posted 4 years ago #

    This definitely is extremely frustrating. I was hoping that it would go into 2.0, but alas!

  6. GuruJi
    Member
    Posted 4 years ago #

    ^ 2.9* I meant.

  7. henkholland
    Member
    Posted 4 years ago #

    Yep, I had my problems with this. You have nice unique numerical ID's for categories but WP ignores them in an XML export/import. It just creates new ones.
    And when learning, I build my own theme, leaning heavenly on this: http://codex.wordpress.org/Template_Tags/query_posts#Parameters where numerical ID's are promoted or at least heavily used as an example.

  8. deez
    Member
    Posted 4 years ago #

    Just letting you know that is is possible to have the same category and tag slug.

    Some of them allowed me to use it straight away, others i couldn't change them to be the same.

    However, if i delete the tag slug and recreated it then allowed me to use the same name.

    Still not ideal, but possible workaround for you.

  9. amp343
    Member
    Posted 4 years ago #

    This is lame... does anybody have a workaround or any advice how to edit the auto-formatting in the backend?

  10. amp343
    Member
    Posted 4 years ago #

    Any idea where to screw up the auto-formatting?

  11. amp343
    Member
    Posted 4 years ago #

    yikes.. looks like the slug must be unique in the table wp_terms

  12. Aaron Harun
    Member
    Posted 4 years ago #

    In WordPress 3.0, removing the "unique" on the wp_terms table doesn't seem to impact performance and everything seems to work.

    This change is absurd. Tags and slugs need to be able to handle different taxonomies and they should not break each other.

    Until this is fixed, taxonomies are basically broken.

  13. needforname
    Member
    Posted 4 years ago #

    Yeah, i can't have the same slug for my blog category of the same name of my portfolio category. Very annoying. WordPress adds a "-2" to the duplicate. Why won't wordpress fix this?

  14. dorianj
    Member
    Posted 4 years ago #

    This is extremely discouraging especially when factoring in wordpress' reputation for cleanliness and SEO-friendliness. What's even more frustrating is how this issue has been brought up by numerous wordpress users yet the development team will not acknowledge it nor offer an explanation.

  15. dorianj
    Member
    Posted 4 years ago #

    In WordPress 3.0, removing the "unique" on the wp_terms table doesn't seem to impact performance and everything seems to work.

    How did you remove the unique attribute? I'm using phpMyAdmin and can't figure it out.

  16. zyrq
    Member
    Posted 4 years ago #

    You can count me in as being frustrated about this...

  17. dorianj
    Member
    Posted 4 years ago #

    BTW, I figured out how to remove the "unique" on the wp_terms table and it DOES break things. The site still works, but if you navigate to a page that has the same slug as another, it will always load the first page created with that slug.

Topic Closed

This topic has been closed to new replies.

About this Topic