• darya8

    (@darya8)


    I am having trouble altering the names of subcategory slugs. Most of my slugs are fine, but a few that I have tried to rename WordPress automatically re-writes the slug as if it were a duplicate even if it is not.

    e.g. For a subcategory “Health” under the parent category “Basics”, instead of rendering https://summertomato.com/category/basics/health/ it says

    https://summertomato.com/category/basics/health-basics/

    If I try to delete this and create the category again, it will create https://summertomato.com/category/basics/health-basics-2/

    I am new to HTML and CSS, but from what I understand I should be able to fix this problem by changing the slug values in the database. I have been searching for a while on how to do this and have not figured it out.

    But now I am wondering if it is not my theme itself that is causing this problem. Is there any way to tell if my theme is not compatible with writing/over-writing subcategories? If it is my theme, do you have any recommendations on how to fix this?

    I am very nervous about trying to alter my database. Tinkering with my theme is less scary. If I do need to alter my database, any suggestions on where to start with this would be much appreciated.

    Thank you for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • stvwlf

    (@stvwlf)

    Hi

    This would not have anything to do with your theme. There is no need to delete a category just because you want to change the slug name. You can change the slug of an existing category by editing or quick-editing the category on the category maintenance screen.

    Category names must be unique not only across categories but also across tags and links-categories. One database table holds names and slugs for all categories, tags, and link categories – table wp_terms

    Suggestion when starting to work in the database is just change one row at a time. So if you mess anything up (unlikely) you will know exactly what you changed and can put it back as it was.

    This is a tutorial on how to change your password in the database.
    You are not going to change your password, but everything explained here is exactly what you need to know.
    https://codex.www.ads-software.com/Resetting_Your_Password#Through_phpMyAdmin

    Instead of editing the wp_options table you will edit the wp_terms table. Once you get it open you will see all the info on your categories, and one column will be the cat slugs. remember that they must be unique and you will be all set.

    Nothing in WordPress code refers to specific slug names, only to terms ID #’s Only if you have written custom code hardcoded to a specific slug name will you need to change anything if you change a slug name.

    Thread Starter darya8

    (@darya8)

    Thank you very much. This was much easier than I thought it would be.

    Cheers!

    xoxoxo
    darya

    jsp_1983

    (@jsp_1983)

    I’ve been having the same issue with a new install (2.9). I haven’t had this problem with one of my older installs (2.6), as I understand that the issue was introduced in 2.7.

    Surely there should be a proper fix for this problem by now?!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PLEASE HELP with subcategories’ is closed to new replies.