Adding Post IDs (6 posts)

  1. Jaxia
    Posted 9 years ago #

    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!

  2. skippy
    Posted 9 years ago #

    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.

  3. Jaxia
    Posted 9 years ago #

    Thanks for the reply :)

    Sorry, this is the more tab thing:

    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?

  4. nickel
    Posted 9 years ago #

    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

  5. Kafkaesqui

    Posted 9 years ago #

    "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:


    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.

  6. Jaxia
    Posted 9 years ago #

    Woo! That's exciting, guys! I cannot wait to try that :D

Topic Closed

This topic has been closed to new replies.

About this Topic