• Why does WP include posts, pages, etc when counting ID ? is there a way to separate ?

    seems odd that pages wouldn’t have their own ID count 1,2,3 and posts would have their own separate ID 1, 2, 3

    another thing i find odd is if i delete all pages, posts, etc and the final count was 5 and tried to start a page it resumes count and ID is set to 6

Viewing 7 replies - 1 through 7 (of 7 total)
  • ID is for the WP internal use, meaning you shouldn’t worry or pay attention to how it behaves.

    If you want more human-readable/representable ID, you need to hack up your own solution.

    Because pages are posts. Can’t separate the two by the post ID, you will have to use something else. Not odd at all once you understand how “page” content is stored.

    On your last “odd thing” which is not odd but very practical, trust me, it’s best to increment. You don’t reuse old post ids, it will only confuse everyone who reads your blog. I link to post-47 about cars, you delete it and write something about religion… well, you can see where this is going.

    Thread Starter ongakukaku

    (@ongakukaku)

    I understand what your saying but, still look at it as ODD :p

    example

    ID made up of pages or posts, etc # 1, 2, 3, 4, 5, 6, 7 now lets say you delete all of them and you create 1 new item, common sense says it should be ID #1

    but WP continues where it left off at # 8 even if you have no more posts or pages, it’s annoying ??

    this of course changes the order of the pages in the sidebar as well, where one may want to maintain a certain order of pages, etc

    ongakukaku, that’s MySQL, not WordPress. It retains the last auto-increment value.

    Thread Starter ongakukaku

    (@ongakukaku)

    yep, i just had a peak in phpmyadmin it holds all old posts even though they don’t appear in wordpress, apparently it doesn’t delete them when they get deleted in wp

    If you delete a post in WordPress, it should be deleted from the database. The point about the ID not resetting is due to how MySQL handles auto-incrementation.

    Just turn on permalinks so that no one will ever see the IDs. ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘ID Posts, Pages, etc’ is closed to new replies.