• I’d played with the post id numbers in PhpMyAdmin a while ago (I have about 70ish entries, and i changed a few of them to number 400 some because changing them back). However, I noticed that when i post new entries now, post id number does follow the 74 to 75 but jumps to 421, 422 etc. It’s not a really big problem, but it’s kind of annyoing and it never did that before, so I’m wondering if I changed something in PhpMyAdmin that I shouldn’t have and how can I fix the problem.

    Thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • Moderator James Huff

    (@macmanx)

    Lower the post IDs back to the way they should be. The next post will always be given an ID which is one unit higher than the current highest ID.

    So, if you have four posts with the IDs 1, 2, 3, and 4, then the ID for the next post will be 5. But, if you have four posts with the IDs 1, 2, 3, and 400, then the ID for the next post will be 401.

    Thread Starter gaebe

    (@gaebe)

    I’ve checked all over. And I have entries numbered from 1-76. When I tried to post a new entry, the number jumps to 427. When I deleted the entry and posted a new one, that one is numbered 428

    What’s your autoincrement value set to on the table? Should be in the bottom left when looking at the wp_posts table’s structure in phpMyAdmin.

    Thread Starter gaebe

    (@gaebe)

    Is this what you mean? I can’t seem to find the autoincrement.

    Row Statistics:
    Statements Value
    Format dynamic
    Rows 77
    Row length ?? 1,784
    Row size ?? 1,864 Bytes
    Next Autoindex 429
    Creation Dec 17, 2005 at 05:31 PM
    Last update Dec 17, 2005 at 06:10 PM

    Moderator James Huff

    (@macmanx)

    Try changing “Next Autoindex” to 77 (or 78 if you already have a 77, etc).

    Thread Starter gaebe

    (@gaebe)

    Can you tell me how to do that? thanks.

    Moderator James Huff

    (@macmanx)

    Can you access the database with phpmyadmin? If so, edit that row, and change the “Next Autoindex” value to 77 (or 78 if you already have a 77, etc).

    Yes, it’s displayed as “Next Autoindex”. My apologies.

    Anyway, you can’t just set the autoindex to the number of row that you have + 1. You need to see what IDs are in use. Click the “SQL” tab and put this in there:

    SELECT * FROM wp_posts ORDER BY ID DESC

    What’s the ID that’s listed first? i.e. the highest post ID? You’ll want to set your “Next Autoindex” to that + 1. So if it’s 77, set it to 78. If it’s 105, set it to 106.

    To change it, click the “Operations” tag and then down at the bottom, edit the value for auto_increment.

    Thread Starter gaebe

    (@gaebe)

    I did all this. The latest entry number was 76. But this is what i get when I tried to change the auto_increment to 77.

    Your SQL query has been executed successfully
    SQL query:
    ALTER TABLE wp_posts PACK_KEYS =1 CHECKSUM =0 DELAY_KEY_WRITE =0 AUTO_INCREMENT =429
    [ Edit ] [ Create PHP Code ]

    Thread Starter gaebe

    (@gaebe)

    ok, i’ve got it, it works fine now. thanks a lot. =)

    Thanks

    I found this topic very useful. ??

    Rob

    Hey, could you help on this. I am trying to do exactly the same thing as gaebe. I have followed the instructions and when i go to “Operations” tab and change the value in the auto_increment field and click ‘go’ it says:

    SQL query:
    ALTER TABLE wp_posts PACK_KEYS =1 CHECKSUM =1 DELAY_KEY_WRITE =1 AUTO_INCREMENT =18

    the field stays as it was. I tested by publishing a new post to see if the would be 1 or 18. it was 18.

    i only have one post – deleted the rest and am now ready to start blogging.

    https://blog.rieder.co.uk – a theme called fufu

    Anyway, what could i be doing wrong? Any ideas?

    Rob

    I tried this and I got this:
    ALTER TABLE wp_posts AUTO_INCREMENT =565

    And it work and now I am starting at 565.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Post id number not following’ is closed to new replies.