WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I thought Wordpress post IDs were only unique within each post type, so that the first instance of each post type would have an ID of 1 and they would count up from there. In order to get a specific instance of a custom post type, you would have to designate that post type in the query.

But according to this answer on another question, post IDs are actually unique to each post, regardless of post type. I checked in the posts table for the site I'm working on now, and sure enough the post IDs are unique. But I'm sure I read somewhere (a couple years ago) that they weren't.

Did Wordpress change the way it sets post IDs, or have I just been wrong this whole time?

share|improve this question
They've been unique as long as i can remember, it's entirely possible whatever you read was either incorrect or the person that wrote it was confusing post IDs with something else(ie. made a mistake). – t31os May 1 '13 at 15:39
up vote 2 down vote accepted

All post types are stored in the same posts table, so they have to use different post IDs. That was always the case, since the the post type page was introduced 2005 with version 1.5.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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