You can do this with just get_terms
– this allows you to fetch all (or some) of the terms from one (or more) taxonomies.
By default it excludes ’empty’ terms, so you’ll need to set the arguments appropriately.
//Array of taxonomies to get terms for
$taxonomies = array('category','post_tags','my-tax');
//Set arguments - don't 'hide' empty terms.
$args = array(
'hide_empty' => 0
);
$terms = get_terms( $taxonomies, $args);
$empty_terms=array();
foreach( $terms as $term ){
if( 0 == $term->count )
$empty_terms[] = $term;
}
//$empty_terms contains terms which are empty.
If you wish to obtain an array of registered taxonomies programmatically you can use get_taxonomies()
Related Posts:
- wp_get_object_terms() to get a list of all the terms attached to all the posts in the current query
- get_terms() for custom taxonomy related to another taxonomy
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Query most popular terms by taxonomy over 2 week period
- Tax query with multiple terms in pre_get_posts
- PHP Warning: Attempt to read property “slug” on bool in tax query
- list all post who have mutual taxonomy as current taxonomy!
- Get All Taxonomy Terms From Get_terms Array With Specific Array Key
- How to show only tagged CPT categories / taxonomies for a custom post type?
- modify strip_tags function to use term slug instead of term name
- How to create a list of terms who’s posts also have a predefined external term?
- Complex Taxonomy scheme
- What is ‘term_group’ for ‘order_by’ in get_terms()?
- Order get_terms by term meta
- How to add images to taxonomies?
- Display all the subcategories from a specific category?
- tax_query in get_posts() not working?
- Get parent id by term id
- How to get_term_children output in alphabetical order?
- When to / not to use wp_get_post_terms vs get_the_terms?
- Custom Taxonomy and Tax_Query
- Using multiple taxonomies to sort Custom Posts
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- Why does WordPress combine a term with the same name in the wp_terms table?
- Correct use of get_the_terms()
- Get terms that contain posts that in turn belong to other terms?
- Get multiple term IDs by slug, and then exclude them in get_terms
- wp_list_categories: order by term order?
- Child terms from multiple parents?
- I have a term_taxonomy_id — is there an API call to get the taxonomy?
- Exclude Child Terms From Parent Posts
- same taxonomy for several post types: how to hide empty in a specific post type?
- How to sort terms with diacritical signs?
- wp_set_object_terms creates relationship to REVISION?
- get_terms(); show private posts when logged in
- Get category ID after wp_insert_term
- Why is my WP_Query not working when tax_query terms are an array?
- get_terms with posts that have a different taxonomy with term x
- How do I access a single term from a post?
- How to get all term meta for a taxonomy – getting term_meta for taxonomy
- Prevent Selected Terms Rising to the Top
- How to order get_term_children output by alphabetic order
- SQL Statement generated by WP_Query not producing expected results
- How to update incorrect post count in taxonomy?
- Term begins with a letter
- get_post_terms not working as expected
- Query set using tax_query with relation ‘OR’ modifies category object?
- wp_update_term not creating new unique slug
- Combine multiple custom user taxonomy in single url
- has_term() does not return when term is assigned post?
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- Ordering Posts with Custom Taxonomy Terms Array
- get_terms() but with additional dimensions?
- Wp set post terms not work
- how is it possible that using wp_insert_category throw a fatal error?
- tax_query: What to pass when I want to have all terms?
- get_terms only show term if there is a post using it
- Get post terms for multiple posts at once?
- wp_update_term: How could i update the “name”?
- WP_Query use for a filter with multiple Taxonomies and Terms
- tax_query shows no results if nothing is selected
- Get the Term List – Ordering
- get complex results set according to category structure
- WP_Query tax_query on ACF post_object
- Dynamically tax_query terms
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- Reduce / optimize calling of wp_get_object_terms() when generating permalinks
- Check if an array of posts has posts from a specific category
- How to add terms to my tax_query based off of the current post
- Get only one product category woocommerce
- How to trace/fix false $term->count, rogue term relationships?
- Change default ordering of taxonomy terms – pre_get_terms
- How to order and count get_terms by specific post type?
- Related Tags Concept
- Get those terms with a specific meta key value
- get_terms() order by term_meta
- Empty tax_query array returns an empty array
- Difference between get_category, get_term_by and get_categories
- get_terms from registered taxonomies not working
- Get list of terms that have posts in another term
- Formulate a url to show posts with both taxonomy terms
- How do I get a list of all categories that a given user has written blog posts for?
- What is the term shortlink structure?
- get_term_by “name” not working with & in name
- I want to loop through Woocommerce Product Catogories and show them in dropdown
- Invalid argument supplied for foreach() in search.php
- setting taxonomy term to bulk posts using ids
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Do I have to set parent when set post term?
- How do I determine if a certain term is in an array?
- Changing stylesheet depending on custom taxonomy terms
- tax_query operator woes
- ‘wp’ action hook not firing in admin and login?
- Taxonomy archive showing no results
- Modify automatically generation of slug when term is created
- Display custom taxonomy on single post
- get_terms ‘number’ parameter does not appear to work
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- Does get_terms() use any sort of caching on its query?
- get_the_terms error