Title: Post IDs misordered
Last modified: August 19, 2016

---

# Post IDs misordered

 *  [Purple Frog](https://wordpress.org/support/users/purple-frog/)
 * (@purple-frog)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/post-ids-misordered/)
 * I realise that the database assigns IDs numbers to not just posts but comments,
   pictures and so on which results in posts not having sequential numbering.
 * However the general progression of the numbers doesn’t match the date my posts
   were written ie. a could write a post today that has ID #20, and write one tomorrow
   that has ID #25, and then one the day after that has ID #15.
 * So I have some old posts with numbers that seem recent but cant be.
 * I read about MySQL 5.something being buggy and screwing up numbering and have
   also read that when you export posts it can re-assign numbers so that when you
   re-import them they can be different, and even read that when importing if it
   finds an ID number clash it will find an alternative free number.
 * We were definitely on the buggy MySQL for a while but have since upgraded and
   have done exports and imports when the site moved but why would numbers of posts
   be wrong apart from that?
 * I have two year old post that according to the numbering gives the impression
   it was written in the last six months. Any ideas why?
 * thank you
 * James

Viewing 1 replies (of 1 total)

 *  [viktormorales](https://wordpress.org/support/users/viktormorales/)
 * (@viktormorales)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/post-ids-misordered/#post-1657074)
 * I am facing the same issue. Playing with theme code, I have noticed the following:
   [
   code] # Would show the fine the order of the posts $args = array("posts_per_page"
   => 2, "cat" =>); $my_query = new WP_Query( $args );
 * # But if: "cat" => -#, for excluding categories, posts would misorder
    $args 
   = array("posts_per_page" => 2, "cat" => -6); $my_query = new WP_Query( $args );
 * # But if: "cat" => #, for including categories, posts would be ordered fine
    
   $args = array("posts_per_page" => 2, "cat" => 6); $my_query = new WP_Query( $
   args ); [/code]
 * So… WP bug?!…

Viewing 1 replies (of 1 total)

The topic ‘Post IDs misordered’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [viktormorales](https://wordpress.org/support/users/viktormorales/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/post-ids-misordered/#post-1657074)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
