You will need to join four tables to get categories of custom post type “review”
- wp_term_relationships
- wp_posts
- wp_term_taxonomy
- wp_terms
by using following query you can get list of categories applied to your custom post type:
SELECT *
FROM wp_term_relationships AS tr
LEFT JOIN wp_posts AS p ON tr.object_id = p.ID
LEFT JOIN wp_term_taxonomy AS tt ON tt.term_taxonomy_id = tr.term_taxonomy_id
LEFT JOIN wp_terms AS t ON t.term_id = tt.term_id
WHERE p.post_type="review" AND tt.taxonomy = 'category';
and then update the type of these categories to your new custom category (i.e. “review-category”)
UPDATE wp_term_taxonomy SET taxonomy = 'review-category' WHERE term_taxonomy_id IN (1, 71, 72);
change where clause according to your category ids.
For more information visit following WordPress documentation links:
Database_Description
WordPress_Taxonomy
Related Posts:
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Query multiple taxonomy in Custom Post Type
- Querying Posts by Taxonomy From Alternate Network Site
- Include different loop templates in search query
- WP_Query search posts by custom post type and custom taxonomy
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Show Two custom Post type and their posts on category page
- How to filter custom taxonomy categories on archive?
- Querying Term Posts in Loop
- Am unable to reset a query properly
- Get next and previous 3 posts in a term in single post page
- Making certain categories of CPT not publicly queryable
- Search / Filter posts on Title/Content OR Tags
- Get parse_query filter to return slug instead of id
- How do I move/order posts with a tag to the end?
- Specific query for custom post type
- Display post content with respect to its title?
- First custom field value (out of several) displayed twice after query
- WP_Query orderby and tax_query
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- WP_Query() with custom post type and taxonomy — get all terms?
- Can I query posts by taxonomy conditionally based on post type?
- Query not work for current taxonomy
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Custom Post Type not showing in main loop
- Custom Search | check multiple meta_value for search value
- Custom taxonomy query showing more than 4 posts
- Custom types, taxonomies and query optimization
- Query Custom Post by taxonomy multiple categories
- Query custom posts from custom taxonomy
- How to divide Subcategories into pages of parent category wordpress
- Check that a slug is present in the get_terms request
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- Displaying all posts by category and showing content on click
- WP_Query for custom taxonomies showing posts from non-specified terms?
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- How to transfer categories (default) to custom taxonomy?
- Get posts of an specific term of a custom taxonomy
- Query Pulling the same post twice
- Query Only Show Text on Posts With Certain Taxonomy Tag
- how to limit query_post to first page?
- Listing custom post type items from a couple of custom taxonomies
- Custom Post Type Permalink / Rewrite not working immediately
- has_term or in_category for Custom Post Types
- how to group custom post type posts by custom taxonomy terms
- Showing current taxonomy terms
- Unable to save custom taxonomy terms in a custom-built metabox
- Define permalinks for custom post type by taxonomy in WP 3.4
- Query by 2 values of a repeater ACF field
- Disable single pages and archives and keep preview
- how to get archive urls with same origin for custom types and terms?
- Custom Query to display posts with custom field
- Get taxonomy description based on variable
- Displaying Metabox value (custom post type taxonomy)
- Pretty URLs for Custom Post Type & Custom Taxonomy with Duplicate Slugs on WPML
- Export entries and multiple custom field meta to .csv?
- Filter by custom taxonomy slug on a custom post type
- Create 3 Level Relations with ACF and WordPress
- Archive page for taxonomy terms
- Add custom taxonomy to post content body?
- Limit amount of posts made within a custom taxonomy
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- Custom post type and taxonomy permalinks
- Exclude custom taxonomy term posts from custom post loop
- Create a permalink structure with custom taxonomies and custom post types gives 404
- Not Able To Render Single-CustomPostType.php File
- Using page slug in wp_query
- Custom taxonomy (categories) on custom post type return no results
- previous_post_link in same taxonomy in custom post type
- Remove taxonomies using register_post_type_args
- Different options per post type in WP_Query
- Display both parent and child custom taxonomy / content
- Get template part with CPT and Custom Taxonomy conditionals
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Is there a way to make child posts inherit parent post terms?
- Custom post types category
- Advanced archive url structure (category, tag and date)
- Setup page template array in a custom post type
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- Custom taxonomy terms as children of multiple custom post types
- Custom Taxonomy and Categories
- Filter in Custom post type to find the parent post
- Excluded Custom Taxonomy Term Posts Displaying in loop
- Listing all custom posts having a specific taxonomy whatever the terms
- Create a Hierarchical List of Custom Taxonomies AND Posts
- Making permalink for custom post type/custom taxonomy. Stuck with 404 in the single post
- Custom Taxonomy page redirecting to 404 page
- Pretty permalink structure with multiple (AND OR) taxonomies
- Filter a custom taxonomy from displaying a button all other taxonomies can show
- Problem with type plugin and custom taxonomies
- WordPress Custom taxonomy template
- Custom post type – two taxonomies
- Check if taxonomy is attached to at least one post in a post-type
- Getting (Invalid) when adding custom taxonomy of custom post type link in menu [closed]
- Display custom taxonomy posts of custom post types
- Post content stays the same but permalink changes ?
- Pagination not working with custom loop
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)
- Taxonomy Archive URL + Template