• I made a couple of test posts in my WP and now i deleted them all.
    Now when i made a new post, the post id just keeps counting.
    So for example: it was the last post had id# 25, then I deleted 10 posts, and the next posts was # 26.
    What i want to do, is have the next post have id# 16 (in my example)
    I checked the mysql database and i can’t find where WP keeps a record of what the last post’s id was. So the question is: what do i have to do, to make WP think that the last x posts weren’t made?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The post ids are auto-generated by mysql. This is simply the way that mysql handles auto-increment fields internally. It’s not under the control of WordPress.
    There may be a way to get mysql to reset the counter, but I don’t know for sure, offhand.

    Thread Starter Anonymous

    Now i know that it was a mysql problem, I made a quick search and found the answer:
    You have to run the command “ALTER TABLE tablename AUTO_INCREMENT = 1;” in mysql. This resets the increment value to the largest value present.
    thanks, my problem is solved.

    Thread Starter Anonymous

    How do you run this command in mysql (i.e. how do you access the mysqul tables)? I would like to fix this problem too, although it’s not the biggest deal.

    Thread Starter Anonymous

    Here is why I don’t think that is necessarily a good idea. Say you have a post I link to that I like and refer to it in something I have written. If you delete the post and use auto_increment, the next thing you write may (and probably will) be totally irrelevant to what I wrote and to which I referred. The idea of “permanent links” is ruined.

    Thread Starter Anonymous

    Well in my case it’s for a new blog, so i want to erase the number skewage from all my test posts. thanks a lot!

    I tried using the solution above, “ALTER TABLE tablename AUTO_INCREMENT = 1;” (without quotes) but mySQL says it doesn’t recognize “tablename”. What table name should I be using? I’m in WP 2.0 now.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘post id after deleting posts’ is closed to new replies.