WordPress.org

Support

Support » How-To and Troubleshooting » Clean up WordPress database unused ID

Clean up WordPress database unused ID

  • 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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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.

    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.

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

    Kafkaesqui
    Member

    @kafkaesqui

    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

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Clean up WordPress database unused ID’ is closed to new replies.