Title: Post Type Switcher plugin post_type bug
Last modified: August 20, 2016

---

# Post Type Switcher plugin post_type bug

 *  [VFHwebdev](https://wordpress.org/support/users/vfhwebdev/)
 * (@vfhwebdev)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/post-type-switcher-plugin-post_type-bug/)
 * I’m encountering a bug with the Post Type Switcher plugin.
 * When I have Post Type Switcher enabled post revisions are getting their post_type
   field in the DB set to ‘post’ rather than ‘revision’.
 * I’ve disabled all other plugins and verified this is still happening. Anybody
   else experiencing this?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Drew Jaynes](https://wordpress.org/support/users/drewapicture/)
 * (@drewapicture)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/post-type-switcher-plugin-post_type-bug/#post-2664261)
 * I can verify this issue as well, been banging my head against a wall because 
   these revisions were showing up in queries from another plugin.
 *  [Drew Jaynes](https://wordpress.org/support/users/drewapicture/)
 * (@drewapicture)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/post-type-switcher-plugin-post_type-bug/#post-2664262)
 * This can be fixed by added a check for the ‘revision’ post type.
 * Open up post-type-switcher.php
 * At about line #126 (inside function pts_save_post() )
 * Add this just before the line starting with `set_post_type( $post_id ...`:
 *     ```
       if ( $post->post_type == 'revision' )
       		return;
       ```
   
 * For posts already affected by this, you’ll have to run a DB query, something 
   like this:
 *     ```
       UPDATE wp_posts set post_type = "revision"
         WHERE (post_name LIKE "%revision%" OR post_name LIKE "%autosave%")
         AND post_status = "inherit"
         AND post_parent != 0
         AND post_type != "revision"
       ```
   
 *  [John James Jacoby](https://wordpress.org/support/users/johnjamesjacoby/)
 * (@johnjamesjacoby)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/post-type-switcher-plugin-post_type-bug/#post-2664263)
 * This should be fixed in 1.1.
 *  Thread Starter [VFHwebdev](https://wordpress.org/support/users/vfhwebdev/)
 * (@vfhwebdev)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/post-type-switcher-plugin-post_type-bug/#post-2664264)
 * Many thanks for the fix! What about the issue with Post Type Switcher and Advanced
   Custom Fields?
 * [http://wordpress.org/support/topic/post-type-switcher-bug-with-advanced-custom-fields?replies=5](http://wordpress.org/support/topic/post-type-switcher-bug-with-advanced-custom-fields?replies=5)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Post Type Switcher plugin post_type bug’ is closed to new replies.

## Tags

 * [post_type](https://wordpress.org/support/topic-tag/post_type/)

 * 4 replies
 * 3 participants
 * Last reply from: [VFHwebdev](https://wordpress.org/support/users/vfhwebdev/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/post-type-switcher-plugin-post_type-bug/#post-2664264)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
