• basher

    (@csirifiszkio)


    Hi!

    I’d like to reset my IDs somehow but wordpress keeps remembering them. After I delete all my posts, I would expect my new first post to have the ID 1. But it is ID 14 let’s say, so it continues from where I left off even though I deleted the old posts.

    The same goes to categories. I made 10 categories, and deleted them all. Now the next one I make will have the term_id 12. Why not 2? Where can I reset the count?
    Any ideas?

    Thanks!
    Basher

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    WP is not the one remembering, it is the DB server. It maintains an auto-increment number for what to assign as the next ID. You can reset this with phpMyadmin. Navigate to the table you want to reset IDs in. Determine what is currently the highest ID number for all the rows with data. Select More > Operations. Under Table Options is an auto-increment setting. You can set it at 1 + the highest ID that exists. Bad things will happen if you set it lower than the numbers currently in use.

    You will likely see other data besides posts in the posts table. These are preventing you from resetting all the way down to 1. You would have to delete all the data to get down to 1. This is generally a bad idea, but in some cases it might be OK. Make a backup (use the Export tab) before you delete anything just in case it turns out to be a bad idea after all.

Viewing 1 replies (of 1 total)
  • The topic ‘Reset Post ID, term_id and term_taxonomy_id’ is closed to new replies.