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);
}
Related Posts:
- how to group custom post types
- Page as child in custom post type slug?
- Number of pages – multiple (custom) post types
- Limit widget to a specific registered sidebar
- Restrict a Post Types Post Status
- WP_List_Table Inside Metabox Not Working on Submit
- How to filter post data with AJAX on page?
- ACF Relationships in Custom Post Type Permalink
- Custom post type permalink structure with the category also acting as an archive
- How to automatically apply a password to all posts within a custom post type
- Custom page type – template under page attributes?
- Custom post type loop split/ordered by taxonomy
- can register_post_type() be safely called before init
- Display two post types ordered by two custom fields
- Custom Post Types, Page Templates and Pagination. Why do I get a 404 Error?
- Change / Delete the default post type and category?
- Registering post type is not adding to admin menu
- Custom Taxonomy Hierarchy for Custom Post Types (eg Categories and Subcategories)
- Output the content of a term organised by each of the CPT?
- Generate Shortcodes by Taxonomy
- Is there a way to connect a custom post type to another custom post type’s taxonomy? (specific to locations)
- Custom Post Types not showing, custom WP_Query
- Pagination is not working on single-{slug}.php but works fine on page-{slug}.php
- How can i change the output of posts_nav_link();
- Add an option in a builder
- Trigger email send after custom post publish
- What is the best way to correlate one-to-many content-type relationships?
- Is there a conditional tag to determine whether the post is _any_ custom post type?
- Add field to all custom post types
- Don’t know how to show custom taxonomies from a custom post_type
- Single template showing all posts of that type
- Cluster CPT posts to users based on ACF value from their profile on dashboard
- Adding sidebar to template creates horizontal gap the size of the side bar
- Featured image in CPT overview column
- Event Custom Post Type Title show by upcoming Event Dates
- How to show featured image block in custom post type for Author?
- How can you use one database with multisite
- Grid Filter Dropdown from Custom Post Type goes blank on Submit
- List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
- Target post type edit page to change view post button, how do I?
- Including link to custom post type in ‘wp_list_pages’ function
- Creating tags via API
- WP_Query Custom Post Type if Category ID Equals
- How to use a variable as a function name?
- post_type_link Filter – Too Few Arguments
- Select2 AJAX and WP Query Returns ALL and does not filter
- WordPress rewrite url
- Archive Page for Multiple Custom Post Types
- Show categories of custom post type and not all posts
- add pagination to custom category posts
- How to create object in wordpress?
- Reusable metabox backend and frontend
- How to loop through custom post type items and add them to a slider if they exist
- Modifying Dashboard edit.php
- How to import database table as custom post type and custom fields?
- Have custom post type Visibility be private by default, and have radio button also set to “Private”
- Custom post type (Jigoshop): unexpected value for $category_id (via $term->term_taxonomy_id) on live server
- Fill custom fields when saving custom post types
- Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]
- Displaying taxonomies as category links within sidebar and creating pages for these
- Can I bind a post_type=’post’ category to a custom post_type category?
- pagination for custom post type archive page
- Add custom posts to submenu automatically
- Hide Published text from custom post types column
- Is it possible to get the specific content on the search page?
- Custom taxonomy: on the taxonomy term page show other taxonomy terms
- Get next and prev item from custom WP_Query and Custom Post Type
- Search for custom field input of a custom post type in ajax live search
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Make bootstrap 5.0 carousel dynamic using ACF and CPT UI [closed]
- WordPress custom post type as homepage with homepage url
- show label text of select option rather than its value in cmb2
- Custom post categories are not displaying on the page
- Pagination Not Working When Used With WP_Query() `offset` Property
- How to select meta key in custom database query
- localize_script or rest api
- Search result based on URL
- Widget area for individual posts (custom post type)?
- Adding categories to custom post type in permalink
- Custom Post Type with Subfolder in Custom Theme
- Link two different post using there post_id in post meta
- Get posts under custom taxonomy and custom post type
- Flush rewrite rules when new cpt is registred
- How do I extract the contents of a CPT’s custom field for all posts?
- Custom field linking problem!
- Remove custom post type generated by a plugin (The Events Calendar) [closed]
- Keep same archive.php for post from archive?
- Use one template for different custom post types with the same markup
- Events with multiple event dates + permalink for each date
- Custom Post Type and Custom Taxonomy not connected
- After rewriting post type’s URL, the number of queries has increased dramatically
- Custom field totals
- How to Associate Posts with Pages
- How to query custom post then display sections by meta value
- Prevent users from changing post status
- How do I paginate a custom post type listing on a custom template page?
- how to show Author post type count
- What is the code for showing Custom Category and Subcategory Page?
- Two pagination in one page without AJAX
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs