WordPress.org

Forums

How to reset post-id to 0? (2 posts)

  1. Shrish
    Member
    Posted 5 years ago #

    Hi, I setup a new blog (having no posts right now). The pemalink structure is http://blog.example.com/postid/postname/. There was a post "Hello World" made by WP, I made another post for testing and then deleted these two posts. Now if I write new post then its postid becomes 3 and permalink becomes http://blog.example.com/3/my-post/.

    I want to reset postid in database to 0, so that if I write a new post it postid starts from 1 (to track no. of posts written over time).

    How this can be done, can it be done using any MySQL command/query in database? (I have installed WP-DBManager plugin).

  2. Mark / t31os
    Moderator
    Posted 5 years ago #

    Backup important data first (just my disclaimer).

    ALTER TABLE table_name AUTO_INCREMENT = x

    x is the numeric value to use for the next entry if i remember correctly.

    You'd need to make sure the WordPress database is selected first, then run the query, setting the table_name and numeric increment value as appropriate.

Topic Closed

This topic has been closed to new replies.

About this Topic