• akanoj

    (@akanoj)


    Hello all,
    I am trying to reset the counter for categories after deleting categories.

    For example, Lets say we have 3 categories: A, B, C.
    Category 1 = A
    Category 2 = B
    Category 3 = C

    I delete Category 2, and make a new Category, D.
    Now we have:
    Category 1 = A
    Category 2 = [Empty]
    Category 3 = C
    Category 4 = D

    Is there any way I can reset the category counter? As in, if I deleted all the categories but Category 1 (which cannot be deleted), then it starts off at the end of the counter.
    For example, delete categories B, C, D – and create a new one “E”
    Category 1 = A
    Category 2 = [Empty]
    Category 3 = [Empty]
    Category 4 = [Empty]
    Category 5 = E

    Is there any way that I can put “E” into Category 2? My category counter keeps getting bigger and bigger, and I don’t want it to.

    I’ve browsed these forums, but many of the solutions are for version of WP that have different functionality from 2.7 – and therefore different menus.

    Would replacing the catgories.js file help? What would that do to the website?

    The website, for reference: https://www.thoughticles.com

    Thank you for your help! I figured it was better to be long and thorough rather than short and vague.

Viewing 1 replies (of 1 total)
  • stvwlf

    (@stvwlf)

    This is a MySQL thing, not a javascript thing. Read up about MySQL autoincrement fields. Yes it can be done but its not a good idea. Its part of database theory – the id # is not supposed to mean anything other than indicating a separate and unique record for every row in a table. When you want to assign sequence to it, you are trying to give it meaning.

    Behind the scenes, category ID’s come from Terms ID’s, which are also used as tag ID’s and link category ID’s, which all come from the same sequence of #’s. The id’s also link records together between database tables.

    From your perspective, of course, what you are asking for is reasonable. But there are implications to doing it that way.

Viewing 1 replies (of 1 total)
  • The topic ‘Deleting Categories – 2.7.0’ is closed to new replies.