WordPress.org

Ready to get started?Download WordPress

Forums

Category slugs (9 posts)

  1. knutaldrin
    Member
    Posted 5 years ago #

    Whenever I try to create a subcategory, wordpress creates the slug as "category-parent" instead of "category", even when I explicitly tell it to name it "category". If I edit the category slug, it renames it "category-parent-2". If I rename it again, it goes back to "category-parent".

  2. webartistry
    Member
    Posted 5 years ago #

    I have the same issue on 95% of the sub-categories I create and it is incredibly irritating. Even more frustrating is one here or there will work as its intended, while the others don't.

    The only thing I've found that consistently works thus far is to (a) change the sub-cat to a two word slug with a hyphen, e.g. "sample-name" or (b) end the sub-cat name with a number, e.g. "sample101"

    It's not perfect, by any means, but at least you get to pick the names yourself.

  3. blankpoint
    Member
    Posted 5 years ago #

    I'm having the same problem, and there are several forum posts that indicate other people have the problem, with no offered solution. Anyone? It was working fine for me and suddenly started doing this in 2.7.1.

  4. rhalpha
    Member
    Posted 5 years ago #

    I had the same problem until I found out that there was duplicate entries in the database and that's why wordpress was creating unique slugs by doing child-parent as the slug.

    Cleanup duplicate entries in database and that should solve the problem.

    Rubayat

  5. darya8
    Member
    Posted 5 years ago #

    Does anyone know how to "clean up duplicate entries in the database"? The database scares me. I don't want to mess anything up.

  6. eworque
    Member
    Posted 5 years ago #

    Same question as darya8..

  7. eworque
    Member
    Posted 5 years ago #

    I found the solution.

    Check the myphpadmin and clear the wp_terms table. All categories and tags in your blog will be deleted. Then start all over again.

    I wrote this in my blog: http://ridhuan.co.cc/blog/2009/04/editing-and-organizing-wordpress-category-slugs/

  8. eworque
    Member
    Posted 5 years ago #

    sorry.. DON'T CLEAR THE WP_TERMS TABLE. Just edit those you want to change. Might also require changes in WP_TERMS_TAXONOMY and WP_TERMS_RELATIONSHIP. Check thoroughly and understand the system before doing any editing.

  9. ryanve
    Member
    Posted 4 years ago #

    Nice article eworque. I had the same issue (wanting to rename a category slug) and when I looked in the terms table I saw why. It was because I had already created a tag that was using the slug I wanted to use. Once I renamed the tag slug, I was then able to rename the category slug (without making any changes in phpMyAdmin). Problem solved.

    For the related issue of removing /category/ from your category url's, I've simply been using the WP No Category Base plugin which easily does the trick.

Topic Closed

This topic has been closed to new replies.

About this Topic