Support » How-To and Troubleshooting » Post IDs Skipping

Post IDs Skipping

  • I’m in my ‘Manage’ -> ‘Posts’ tab and notice that the Post IDs are skipping around, here are the numbers in order:

    3619, 3618, 3616, 3615, 3613, 3610, 3609, 3607, 3605

    Any clue why it’s doing this?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Moderator Ryan Boren


    WordPress Dev

    IDs are incremented whenever a post, page, or attachment is created. If you’ve created pages, they will get an ID and create gaps between posts. If you save a draft post, it will also take an ID. If you then delete that draft, you don’t get that ID back. The ID is strictly incrementing.

    Right, right, I’ve used WP for almost 2 years, I Know how it works. But I don’t create drafts without finishing them, and even at that, I don’t really create drafts.

    Also this problem started when I upgraded to 2.0

    The post ID is controlled by MySQL’s auto_increment value, not by WordPress. When a new row gets inserted into the database, MySQL gives it’s ID the value.

    Have you looked in the database to see if any of the “missing” IDs are being used? If not, then either you MySQL server is going crazy or rows are being inserted and possibly later removed.

    One of the WP blogs I’m adminning has been skipping IDs. When I looked in the SQLdb, I found image filenames in the TITLE field in SQLMyAdmin in otherwise blank SQL records.

    In example, the image “http://site.com/images/joe1.jpg” is used in post ID #1. All the fields in the SQL record for post ID #2 are totally blank, except for the filename “joe1.jpg” in the TITLE field of post ID #2.

    If post #1 contains joe1.jpg, joe2.jpg and joe3.jpg, those filenames will appear in the TITLE field for the SQL records which SHOULD be for post IDs #2, #3 and #4.

    When a new post is published, the post ID will resume at the next blank record.

    Anyone got a fix for this?

    I’ve also noticed that in those records where only the image filename appears, the POST_STATUS field, instead of reading ‘published,’ ‘draft,’ etc. reads ‘attachment.’

    Yep, that’s your attachments.

    Is there something not working?

    One more observation. This problem started on a specific date. I have gone looking for any settings which the blog’s owner may have changed, but I can’t find any that would apparently cause this problem.

    Thanks for the reply, HS.

    I’m wondering why the posts prior to 11 Mar 2006 are all sequentially numbered and don’t have ‘attachments,’ but those after that date do have attachments which occupy a post ID number.

    I’d surmise that’s when you upgraded to WordPress 2.x, as that’s an expected 2.x behavior.

    Brilliant, thanks for that. Was investigating another problem (post would not appear despite published status) and ran across this anomaly in the SQL records.

    Much appreciate your help.

    Glad to be of assistance. 🙂

    Do you have another thread going about the post not appearing?

    not yet- I’ll post that later if I can’t fix it. 🙂

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