Support » Fixing WordPress » Category Numbers in the Thousands? Why?

  • I am cleaning up my site and decided to break things down into a few new categories to help people isolate the information they want. Imagine my surprise when I was checking the category panel in admin and found that the number sequence of categories goes 61, 62, 63, 4452, 4453, 4456, etc.


    Why would the numbers suddenly jump to the THOUSANDS in the category list?

Viewing 15 replies - 1 through 15 (of 22 total)
  • I don’t know. Did you do anything unusual with permalinks or some such?

    Nope. I don’t have permalinks turned on yet.

    Well, gosh. That was my single not-so-bright thought.

    I can’t see anything that would account for this behaviour. The category_id column is auto incremented by MySQL and thus should be sequential. Are you using any category/tag plugins?

    Alos note that it is possible to reset the AUTO_INCREMENT counter through MySQL. However, as this is not affecting anything else, I’d be tempted to just acknowledge this situation has occured and move on.

    Like what category or tag plugins? I have plugins running, but nothing, I think, other than Adhesive, which might impact categories when entered in the Category admin panel…

    I just discovered it, so I don’t know if it is affecting anything else. OMG, it might be a terrorist category mangler…kidding. I’ll have to poke around and see if anything else is borked.

    I manually went in and changed them to something more manageable, but I thought it might be worth mentioning. If others pay attention, this could be caught as a bug. If it is just me…well, it won’t be the first time. 😉

    Well, I’m running adhesive too, the only cat-type plugin I have installed, and I have nowhere near 60+ cats, but mine are just fine – from 1 on up normally….

    Oh, yeah, well, there’s a consequence of changing the category ids to something more in keeping with the sequence – none of the children of the parent categories where I made the changes show up.

    None of the categories I changed had children, but they are now lost to their parents, so I have to go into the database and track them down….I think I’ll try changing them in WP category panel first – so something else and then back and see if they show up then.


    Each of posts is tied to one or more category ids. If you change the category ids, you have to update its reference in wp_post2cat table.

    Thanks….that will make it easier.

    Well, I poured through the wp_post2cat table and fixed them all. Nice save, alphaoide! Thanks.

    Hopefully it won’t happen again, Lorelle….


    I just added two new categories and it did it again!

    I spent way too long fixing all this last night. Dang it!

    The auto-increment is on, but I want to try to reset it. What will that do? Totally realign all of my preciously done categories or just fix it so the next ones will be in line with the rest of the count?

    I hate this!

    Oh jeez. Gremlins. I hate gremlins. There’s got to be something wonky in the auto-increment then – really, if that’s the only code you have addressing the relevant areas….

    Is this an add on or does it come with the package? (Autoincrement I mean….)


    To reset the auto_increment counter, you can run do the following.

    You’ll need to remove all the records from wp_categories and wp_post2cat tables where the category id is greater > the sensible value i.e. 70.

    You’ll then need to run the following in MySQL:
    ALTER TABLE wp_post2cat AUTO_INCREMENT = 70

    Now the category_ids will start incrementing from 70.

    However, as this appears to be only a cosmetic issue, my advice would still be to just live with it. However, if you do decide to do this, make sure that you back up your DB before doing so. I cannot stress this enough. Direct DB manipulation is inherently risky so make sure that you’re in a situation to recover from any mishaps.

    I tested this on a dummy table that I generated which was successful but I cannot guarantee that this will be the same in your case as I neither have access to nor enough information on your system.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Category Numbers in the Thousands? Why?’ is closed to new replies.