Support » Fixing WordPress » Just a side question about how WP assigns IDs…

  • Resolved lelion


    Hello everyone,

    I am just curious about the following:

    I have two blogs. They share the same database but have different prefixes, so as to make things smoth (wpbg_ and wpen_).

    The blogs are quite new and I didn’t publish a lot of posts yet – maybe 15-20 in each one.

    I use standard permalinks – /blog/year/month/date/post-title-here/. So I don’t mind a lot about ID of certain post.

    But what I am curious about is why WP assigns more IDs than it should, to my posts? They do not go like 1, 2, 3, 4 etc but rather 1, 3, 6, 8, etc. So for my post number 20 has an ID 80.

    I looked into the MySQL database… What I saw a bit puzzled me – I think WP assigns a unique ID every time I upload a picture to one of my posts! So some of my IDs are taken by uploaded pictures… Hmmm…

    I expect this is correct behavious? (I guess, only WordPress developer can unveil this mistery…)

    I am asking because I’ve seen other blogs running WordPress and most of the times post IDs go like 1-2-3-4-5-6-7 etc. (Those not using nice permalinks)

    I am using nice permalinks and I don’t care, as long as things go smoothly; but I am just curious as to is this a normal behaviour :)))

    Thanks for anyone which might shed some light on this:)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Yep, that’s expected behavior.

    Uploaded pictures get an ID.
    Pages get an ID.

    It has naught to do with Permalinks (well aside from seeing the id on the querystring with default, I suppose)

    If you’re seeing someone with a full sequence, they’ve either never uploaded a picture or created a Page, or they’re running an old old version of WP. 🙂

    Uploaded pictures get their own post entry. Pages are just another form of post. So yes, they all get IDs in the posts table. This is by design.

    Thank you for the replies, fellas 🙂

    I am much calmer now 😉

    As to the people who have 1-2-3-4-5-6-7 etc. sequences, I’ve seen them running latest WordPress, so I guess, it’s the other reason – they never uploaded a picture using the built-in upload manager :)))

    Thanks again! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Just a side question about how WP assigns IDs…’ is closed to new replies.