Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.