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
- Querying both pages and posts
- Which post does a taxonomy term belongs to?
- How can I set taxonomy programmatically
- How to hook custom taxonomies to custom post types and make the permalinks work?
- Custom post type multiple loop by taxonomy term
- getting all values of a custom taxonomy if there is no post
- custom types taxonomy hide_empty
- Help need making decision. Ads rotating site on wordpress
- Extending AZIndex plugin to use custom post types and custom taxonomies
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- A question on creating filters for custom posts using taxonomy
- Conditional Query of Custom Post Type and custom taxonomy
- Listing tags from a custom post type
- List custom taxonomy specific to one custom post type
- Is $object_type truly required with register_taxonomy()?
- Custom Taxonomy back-end customizations
- Show a Category X’s custom post type on Category X archive page?
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- Meta query for custom post type ignored in main query
- Get Taxonomy Term Title by it’s URL
- Add custom taxonomy to post content body?
- custom taxonamy and post type
- Taxonomy custom post type URL
- Display as tree terms of taxonomy and custom posts for each term of taxonomy
- Second Set of Eyes: One custom taxonomy shows in Appearance > Menus, one does not
- Custom post type url with category
- Custom Taxonomy terms aren’t getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?
- Querying Two Custom Post Types with OR Not Working
- Adding custom post category slug in permalink causes 404 error for pages and posts
- Add custom image size for custom post type or taxonomy
- Get taxonomy values based on wp_query results
- Display post as term id
- Ajax Custom Post Filter is not filtering
- Need Output Custom Taxonomy from Custom Post Type
- Display all taxonomy terms, add class if term applies to current post
- WordPress sort search results by custom order
- How to filter wp_list_categories output with some custom post type meta query?
- Custom Post Type – No Results Found
- Return the latest post from a custom Taxonomy and Post Type
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- Don’t know how to show custom taxonomies from a custom post_type
- How to Filter custom post type by taxonomy?
- 404 error when navigating to a taxonomy page with Cyrillic, what’s wrong?
- Custom taxonomy rewrite give pagination 404
- How to duplicate entire custom post type
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Use Custom Post Type archive page for the taxonomies term archive page
- How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?
- Is it possible to have dedicated page for parent/child taxonomy?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Can a Custom Taxonomy be named “category” like normal Posts?
- How to use terms from the same custom taxonomy in different roles in a custom post type?
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- How do I display the taxonomy term alongside the post type post title?
- Display custom post type category, while in a CPT category, then the posts beneath