Grow your CSS skills. Land your dream job.

Multiple WP Categories with Same Name

  • # November 4, 2013 at 4:23 am

    Hi all,

    Ran in to a bit of an issue recently. I’ve been learning WordPress as a I go along and am well aware I have have missed out on some key tricks. I have created a website that has a large number of categories, the issue I am having is the conflict of categories with the same name, for example – if it were a shop it would be like this:

    Mens
    – Hats
    – Shirts

    Womens
    – Hats
    – Shirts

    WordPress doesnt allow the same name of a category to be used. What is then typically the way of doing this? At the moment I have made the categories uniquely named which isnt ideal. I would want the URL to be mysite.com/base/mens/hats/post-name. Is this where new taxonomies come in? If I wanted a Mens page would I be able to grab all the ‘sub-categories’ from Mens if they are not actually categories but instead a new taxonomy? Or is it in fact nothing to do with taxonomies?!

    Hope that was clear enough..

    Thanks

    # November 4, 2013 at 4:48 am

    Keep in mind that the “Category” selection already is a taxonomy. It’s the one taxonomy that is included with a default WordPress install.

    Now, it IS possible to have subcategories to have the same name, so this should not be a problem at all:

    Mens
    – Hats
    – Shirts

    Womens
    – Hats
    – Shirts

    But indeed, in the path there will be a distinction (as long as you have the proper Permalink settings, like %category%/%postname%), the paths will be something like this:

    site.com/men/hats/some-post
    site.com/men/shirts/some-other-post
    site.com/women/hats-women/yet-another-post
    site.com/women/hats-women/and-another-post

    Having any additional, custom taxonomies probably won’t help — it’d act the same as the “Category” taxonomy, in such that it will “rename” the category name in the path if it’s duplicate.

    # November 4, 2013 at 5:09 am

    Ah I see, thank you. Is there no way of having both men/hats and women/hats then? Is this perhaps where tags come in instead? I understand why we cant have multiple of the same permalink as WordPress wouldnt know which to show.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".