• From searching, I learned how to change a post ID and was able to get it to work. My problem is that I need to insert a placeholder in every post ID that I am missing. But if make a new post and change the ID, then the post id still goes up.

    For example: I make a placeholder entry and it is given ID 50. I go into the sql table and change it to 7. Everything is happy. However, when I make my next post, it has ID 51, not ID 50. This defeats the purpose of trying to fill in the missing IDs.

    Does anybody know how I can fix this? I am trying to get the “more tab” javascript to work on my site, but it seems to depend of numbers starting at one and being in order with none missing.

    Thanks for any help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’m not sure what the “more tab” is.

    But post IDs are, by design, auto-incementing. There’s no facility to “fill in” any gaps that arise, because for the overwhelming majority of users the actual post ID doesn’t matter to anyone but the MySQL database.

    If uninterrupted sequential post IDs are important to you, the only practical choice is to start over with a fresh database, taking care to create new posts in the order in which you need them.

    Thread Starter Jaxia

    (@jaxia)

    Thanks for the reply 🙂

    Sorry, this is the more tab thing:
    http://wordpress.org/support/topic/33554

    I don’t know enough about javascipt to know if it is critical to have uninterrupted IDs. I just have everything set up right (I think) and after talking to the guy who made that post, missing IDs is the only problem we can think of.

    Is there some other way to auto number the posts I actually make?

    There’s actually an SQL query that you can run to reset the auto-increment to the highest value currently in the database (in case you delete some entries, for example). Not sure what it is off the top of my head, but I’ve found it in the past, so I’m sure you’ll be able to dig it up.

    Hope this helps, nickel

    “There’s actually an SQL query that you can run to reset the auto-increment to the highest value currently in the database “

    Yes, it goes:

    ALTER TABLE tablename AUTO_INCREMENT=x;

    tablename is replaced by…the table’s name (wp_posts — change the table prefix if not using the default), and x by the numerical value for where to start, which should be the next *available* ID.

    Thread Starter Jaxia

    (@jaxia)

    Woo! That’s exciting, guys! I cannot wait to try that 😀

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding Post IDs’ is closed to new replies.