WordPress.org

Ready to get started?Download WordPress

Forums

Clean up WordPress database unused ID (6 posts)

  1. harchew
    Member
    Posted 6 years ago #

    Currently I have thousand of records and the IDs are pretty long. However I realize there was a big range of difference in the ID eg.(1,2,3,4,5,6,1020,1021,1022,1023)in between the records. I believe this will generated when I deleted 800 of post records at one shot recently. So is there any plugins or solutions out there to clean up and remove all the "unused IDs" in wordpress database.

  2. moshu
    Member
    Posted 6 years ago #

    There is no such thing as "unused id". They have been used for those deleted posts. And that's the nature of the database: the numbering is incremental, so if you delete 10,000 posts, then the next ID will be 10,001.

  3. harchew
    Member
    Posted 6 years ago #

    I believe there should be a solution out there. Currently I am in the testing stage, so most of the time dummy records are being created. Once the data structure is finalizes, records will be be deleted and ID should be regenerated according to the last ID.

  4. moshu
    Member
    Posted 6 years ago #

    Ask in a MySQL forum if you want to learn more about the nature of the database. This is NOT a WP issue.

  5. Kafkaesqui

    Posted 6 years ago #

    As moshu notes this is a MySQL issue. If you need to reset the AUTO_INCREMENT value on a table, see:

    http://dev.mysql.com/doc/refman/4.1/en/example-auto-increment.html

  6. rrhobbs
    Member
    Posted 6 years ago #

    What I think IS a WordPress issue about this (altho, more specifically, it may be a theme issue?) is that (at least, using using K2 as I am ) if there is unused post id requested, the user doesnt get a "normal" 404 page, on my site the user gets "just not found!" page - and what's worse is the meta data is duplicated for any other post id requested and not found - I am trying to figure out a way to send this request to a "normal" 404 page so my HeadSpace plugin can give it a unique description and my AskApache 404 plugin can give the user some content choices to investigate further... and so Google Webmasters Tools wil stop crying about all the dupe meta descriptions.

Topic Closed

This topic has been closed to new replies.

About this Topic