• Hello everyone.
    Anyone could explain how WordPress assigns IDs to posts?
    I thought it started from 1 and incremented by one, but I have a local installation of WP in which I have posts with IDs from 1 to 83 (with some holes), then the next ID is 212707, then continue incrementing by 1 (with some holes).
    What could cause this behaviour that sounds very strange? Maybe a bug in MySQL?
    For sure I didn’t modify the ID in database, nor I wrote over 200k posts…

    Thanks in advance
    Riccardo

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Something may have cased MySQL to increment the auto index for the posts table. I wouldn’t worry about it as it’s a totally internal thing. Also, the index is (if I recall correctly) a 32 bit unsigned integer, so you have some room for more posts.

    Also remember that “posts” in the database table are not just posts. They are also pages, products, auto-drafts, revisions, attachments, and pretty much any other content type that you’re using on your site. What I’ve seen is even when starting a new post, you’ll get a jump fo 2 because the initial creation will be an auto-draft, and the second one will be the actual post itself. ALso, when you add in attachments, these take ID’s as well, so if you’re uploading a post with 5 attachments as well, that’s a minimum of 6 ID’s used.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress Post ID Policy’ is closed to new replies.