When I exported my posts I noticed that some of the ID numbers were missing e.g. it started from 8 and went to say 21 and then from 24 to 30 etc. Is it possible to reuse IDs 1-7 (or any others that are not shown in the export) as they're obviously currently not being used? Or is there any way to clean up the database so that the IDs start from 1, 2, 3, 4 etc? Thanks in advance for any help you can provide.

  • 3
    Reusing IDs doesn't improve performance, and there's no risk of them running out. Also, uploaded media are represented in the database as posts of type attachment and have their own post IDs, are you sure the IDs aren't for those? Also, remapping post IDs is a non-trivial thing that will almost certainly break things without extensive modifications. This isn't something you need to clean up, and trying to do so can actively harm both your site and performance – Tom J Nowell May 18 '19 at 15:27
  • Welcome to WordPress Stack Exchange :-)! We love to help. Though you left one thing unclear: Why would you want to do this? What do you hope for when reusing old IDs? – leymannx May 18 '19 at 16:20
  • Thank you for responding to my question. I was just intent on tidying everything up and yes, also hoping it would improve performance. Think I will leave well alone! Thanks again. – hs1972 May 23 '19 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.