Merging two Custom Post Types into one

You can ran a simple query once and remove it from your code, something like this:

if (!get_option('updated_my_books')){
    global $wpdb;
    $wpdb->query("UPDATE $wpdb->posts SET post_type="publications" WHERE post_type IN('books','magazines')");
    update_option('updated_my_books', true);
}

Leave a Comment