Merging two Custom Post Types into one

I am new to all this so my ignorance may get in the way.

I inherited a WP Blog with Custom Post Types. There are 4 Custom Post Types, out of which 2, Books and Magazines, have the same fields: Custom_Post_Type_Name, Author, City, Address, Categories, Tags, Date.

Read More

I need to merge these two Custom Post Types into one. More specifically, I need to merge Books into Magazines and rename this new merged Custom Post Type to Publications.

Can someone please show me how to do this?

Related posts

Leave a Reply

1 comment

  1. 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);
    }