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.

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?

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

Leave a Reply

Your email address will not be published. Required fields are marked *