WordPress.org

Ready to get started?Download WordPress

Forums

WP 2.7 Page ID Counter is out of sync. (7 posts)

  1. misty9
    Member
    Posted 5 years ago #

    There have been totally 70 pages on my blog and the last page ID was 70 before upgrading to WP 2.7. I've just created a new page today and WP has assigned ID 133 to this new page. Has anyone encountered this issue?

    Here is one of the bugs that I've logged against WP 2.7.
    http://trac.wordpress.org/ticket/8917

    I've found multiple issues since upgraded to 2.7 a couple days ago. I have been logging bugs since I have upgraded to it. I wish that I didn't upgrade to 2.7. Is it possible to go back to 2.2 from 2.7?

    There is another bug that someone else logged and I have experienced the issue as well:

    http://trac.wordpress.org/ticket/6315#comment:17

    Thanks.

  2. Lester Chan
    Member
    Posted 5 years ago #

    Does it matter? If you delete a post and add a new post after that, the ID will be skipped as well.

  3. MichaelH
    Member
    Posted 5 years ago #

    Going back to 2.2 requires your restore your 2.2 backup (after DROPping the 2.7 tables) and restoring your 2.2 files (after deleting your current files).

    Revisions and attachments take post ID numbers and as GamerZ said, deleting a post will cause the problem.

    I'd recommend sticking with 2.7 and trying to live with the ID number issue.

    There is a plugin call Reveal Post IDs you may want to look at:
    http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/

    You can also use http://wordpress.org/extend/plugins/disable-revisions/ to not have revisions so it doesn't use IDs, but again, attachments do use IDs.

    PS I think I've told you some of this before ;)

  4. misty9
    Member
    Posted 5 years ago #

    Thanks guys for your replies.

    "Does it matter? If you delete a post and add a new post after that, the ID will be skipped as well."

    Yes it does matter to me. I had no plan to delete any page ids or post ids. It just doesn't make sense when you have 70 pages when WP 2.7 thinks that you have 133 pages.

    When WordPress messes up the counter for page or post ids, I can't help wondering what other components are going to be messed up by it. I may not be able to find my existing pages one day if the basics don't even work correctly ;-). All I have been doing is logging bugs and figuring out the issues generated by WP 2.7 since I've upgraded to it a few days ago.

    How could they even release such a buggy software 2.7 ???

    No thanks, no WP 2.7 for me!

    I have already figured out how to go back on WP 2.2. untar the tar file for the file system as well as for the database. I will upgrade to future WP releases after they do in depth testing and adding back the Page ID information in the Page Edit in Site Admin.

    Thanks.

  5. Lester Chan
    Member
    Posted 5 years ago #

    Perhaps you can explain why it does matter to you? It is just a way to identify post.

    ANY web software you used will not have sequential ID as times goes by or I have not come across one yet.

    And lastly THIS IS NOT A BUG. If WP AutoSave a post, it will create an ID as well and hence the next post you published, the ID will be skipped as well.

  6. misty9
    Member
    Posted 5 years ago #

    GamerZ and MichaelH,

    "As for the page counter, Thats correct. The ID's are used by posts, pages, revisions, and attachments, so you'll never get 1, 2, 3, 4....10000 unless you only create pages and disable revisions."

    You are blindly defending WP 2.7 having the Page and Post ID counter issues. Please take a look at the existing bug

    http://trac.wordpress.org/ticket/8635

    The user has specifically pointed out the cause of the problem by the SQL statement, which is missing some key Where Clause conditions. That is a true bug just like what I had said in the first place.

    The reason that I've got 133 pages rather than 70 is the incorrect SQL statement in your WP 2.7 code.

    select count(*) from wp_posts where post_type = 'post' ;

    Thanks to mlebkowski, the correct SQL statement is the following:

    select count(*) from wp_posts where post_type = 'post' and post_parent = 0
    -> and post_status != 'inherit' -- there are two posts with inherit status... dunno
    -> ;

    This is simply a bug if you understand the SQL statements.

  7. Lester Chan
    Member
    Posted 5 years ago #

    That is post count, what is it has to do with post id?

    Post with Inherit status also takes up 1 ID in the post database, so your post will not be sequential.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.