I've just created a draft on my blog, and it's post ID is 1. After creating another draft, the post id for this last post is 3! I was hoping to see them in sequential order, so in the future I'll have a nice auto-incremented numbering like


some months later...


I have no problem diving into code, but I was wondering if someone happens to know a simple solution to achieve this.

Thank you.

  • Seems these guys have worked out some code etc for dealing with this type of problem. Check this out and you may find your answer. - wordpress.org/support/topic/… However, I believe they are using a custom field to do the re-ordering, so I'm not sure if this will work with your permalink structure. Commented Aug 31, 2010 at 15:48
  • Out of curiosity .. why does it matter?
    – tomjedrz
    Commented Aug 31, 2010 at 17:12
  • Also, why would you want to do this? Numeric URLs impart very little information to the (and nothing to search engines.) Commented Aug 31, 2010 at 21:36
  • Would be nice to count how many blog posts are there. Where can I find any proved info that the blog reader pay attention to the wordy post permanent link? I for one don't pay that much of attention. Still, I'm aware it's not search engine friendly at all.
    – rapfaria
    Commented Sep 1, 2010 at 2:57

3 Answers 3


The ID of a post is not meant to be a sequence number in the sense that for post N the following post is N+1. The ID is an auto-incremented field in the posts table, which includes many things that are not published posts, e.g., drafts, pages, attachments. So there is really no way to force WordPress to assign sequential IDs in that field.

There are ways to produce a sequence number and then use it in the permalink structure, but any efficient system will involve storing the IDs in a separate location (table or option) and writing a custom rewrite plugin. That last bit is quite advanced.

It would be an intriguing problem for the experienced hacker to produce a plugin that solves this problem without significant performance degradation.


Pages and posts share ID's so I doubt that will work

Also - The best permalink structure for SEO is to include the postname in there


As the others have explained, the post ID is an auto-incremented field in the database, and so is not otherwise controllable. You obviously don't want to use this in your permalink.

Plugins and custom fields are an option, but not recommended because any "naked" number has the possibility of being misinterpreted by WordPress as a post ID or other internal number like year or date.

A simpler solution that doesn't require custom fields or plugins is to edit the post slug for each post and give it a sequential number preceded by a constant alphabetical prefix.

For example, instead of:




Changing your permalink structure, you could even shorten this to:


You can replace the "p" with whatever you want, like "day1" or "deep-thought-1".

  • In this case, your permalink would be /%category%/%postname%/ or /%postname%/.
    – Doug
    Commented Aug 31, 2010 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.