WordPress.org

Ready to get started?Download WordPress

Forums

Post IDs Skipping (14 posts)

  1. ian2
    Member
    Posted 8 years ago #

    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?

  2. Ryan Boren
    WordPress Dev
    Posted 8 years ago #

    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.

  3. ian2
    Member
    Posted 8 years ago #

    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.

  4. ian2
    Member
    Posted 8 years ago #

    Also this problem started when I upgraded to 2.0

  5. 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.

  6. weezil
    Member
    Posted 7 years ago #

    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?

  7. weezil
    Member
    Posted 7 years ago #

    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.'

  8. Chris_K
    Member
    Posted 7 years ago #

    Yep, that's your attachments.

    Is there something not working?

  9. weezil
    Member
    Posted 7 years ago #

    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.

  10. weezil
    Member
    Posted 7 years ago #

    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.

  11. Chris_K
    Member
    Posted 7 years ago #

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

  12. weezil
    Member
    Posted 7 years ago #

    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.

  13. Chris_K
    Member
    Posted 7 years ago #

    Glad to be of assistance. :-)

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

  14. weezil
    Member
    Posted 7 years ago #

    not yet- I'll post that later if I can't fix it. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags