Support » Fixing WordPress » Gaps in post numbering—How to restore?

  • Resolved Orin


    I have my permalink structure set up like so:

    Problem is, some post #’s are missing on account they were deleted drafts. So there’s no 7-10, fr’instance. I’d like everything contiguous, and I’m up for rewriting history, but when I try to edit #7 by going to:


    it doesn’t work. After manually editing the publish status, post-slug, and timestamp, it still won’t show in the admin section and there’s still a 404 not found error on the site. Anyone have a solution?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Pizdin Dim


    Because you’ve deleted your drafts, there’s no way to re-use those post-id’s again in WordPress, as they’re auto-incrementing. I haven’t tried this myself, but I believe that you should be able to reinstate them with a web tool called “phpmyadmin”. Otherwise, you’ll have to dump, edit (change the post-ids) and reload the database.



    Well, I didn’t think I’d be able to do it but it worked. Thank you kindly, Mr. pizdin_dim.

    I went to wrdp1 » wp_posts » browse, then edited the ID value of a newer post (33) to be an empty post (7). Worked fine although now I guess I have a new hole to plug. Oh well.

    Mark (podz)


    Support Maven

    Be very careful doing this as unless you know which database tables use other database tables, you risk breaking things.
    For instance, if post(33) had comments and those comments linked back to post(33) by referencing the post ID, then changing the ID will not only cause them to disappear from that post, but they will also appear mysteriously when post(33) does get written.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Gaps in post numbering—How to restore?’ is closed to new replies.