Forums

Automatically Generate Sub-Categories (4 posts)

  1. ndev2k
    Member
    Posted 1 year ago #

    I have imported some posts into my blog and they have been placed into the correct categories but rather than go into sub-categories the sub-cat name has just become a tag. All the posts have one tag which is the sub-category name I wanted.

    Is there any quick way to convert the tags to a subcategory without needing to go through each post manually?

  2. duck__boy
    Member
    Posted 1 year ago #

    You'd need to manipulate the DB, which is tricky but can be done if you get your head around it. Instructions below.

    0 - MUST BE DONE FIRST - make a back up of your DB, just in case somthing goes wrong.

    1 - Log out of your websites admin area.

    2 - In the 'wp_terms' table -
    a - locate the tag you wish to change to and note the 'term_id'.
    b - locate the cat that you wish to be the parent of the new sub-cat and also note that ID.

    3 - In the 'wp_term_taxonomy' table -
    a - locate the 'term_id' that you have just noted for the tag you wish to change.
    b - click to edit this row.
    c - change the column 'parent' to the 'term_id' of the of the cat you wish to use as the parent
    d - change the column 'taxonomy' to say 'category'.
    e - click 'Save'/'Ok'/'Go'/What ever your DB manager users as the button

    4 - Log back in to your admin area and check to ensure all is good.

  3. ndev2k
    Member
    Posted 1 year ago #

    This works but it is a little long winded when I have over 1000 posts with about 250 different tags to change. Is there no plugins that will take the tags and make them into subcategories?

  4. duck__boy
    Member
    Posted 1 year ago #

    Don't know, have a search for one - try using 'custom taxonomy' as a search term as well as 'tags' and 'categoris'.

    If none exist, perhaps you could consider writing one - sounds like it wouldn't be an uncommon situation for somone to find them selfs in.

Topic Closed

This topic has been closed to new replies.

About this Topic