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
- Get parent id by term id
- When to / not to use wp_get_post_terms vs get_the_terms?
- Why does WordPress combine a term with the same name in the wp_terms table?
- Get terms that contain posts that in turn belong to other terms?
- Child terms from multiple parents?
- How do I access a single term from a post?
- SQL Statement generated by WP_Query not producing expected results
- has_term() does not return when term is assigned post?
- get_terms() but with additional dimensions?
- Wp set post terms not work
- tax_query shows no results if nothing is selected
- Get the Term List – Ordering
- WP_Query tax_query on ACF post_object
- Reduce / optimize calling of wp_get_object_terms() when generating permalinks
- How to add terms to my tax_query based off of the current post
- 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?
- I want to loop through Woocommerce Product Catogories and show them in dropdown
- setting taxonomy term to bulk posts using ids
- Modify automatically generation of slug when term is created
- 404 on term taxonomy archive pagination only with some terms
- Get posts by querying taxonomy and certain terms of the taxonomy?
- How do I taxonomy terms based on terms they are used alongside?
- Clone Terms of one taxonomy to another
- Get random out from get_terms()
- wpdb->term_taxonomy count posts from both published and private posts?
- Retrieve Custom Taxonomies according to posts selected
- Conditional based on number of specific custom taxonomy terms in archive.php
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Get terms that contain posts that in turn belong to other terms?
- Faceted search with WP-API data
- Show List of Terms (not posts) that have been Recently Updated?
- Query to get term id using post id?
- simple tax_query intersection
- Get all terms linked to a post and include those who not connected from get_terms and sort
- Add HTML to Term Description
- get_term_link is Ending to single.php
- Get terms within a custom taxonomy
- How to get terms of not only the current cat but also of all its children
- How to get the $meta_type given the $object_id
- How to print term name inside wp post loop
- How to create a array that contains all of the children slugs of a specific parent category
- Getting terms to have space between them
- Custom term templates
- INSERTING Data into table with placeholders
- WP_Query tax_query – Show results if child has parent X
- List terms of custom taxonomy if matches other taxonomy
- Taxonomy Drop Down with hierarchical view using $terms
- Create Terms on taxonomy by text field
- Customizing the wordpress tag-cloud output
- Exclude taxonomy term from list of current taxonomy terms
- Trash Bin for Categories?
- get_terms() delivers wrong count with custom taxonomy childs on custom post type
- Show posts from two specific category in WP_Query
- WP Query by 4 different taxonomies
- wp_query with meta_query and tax_query
- Cannot get to work tax_query array for terms
- wp_set_object_terms() to update a post taxonomy value
- Order get_terms by multiple values
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- Confused by get_the_terms to use in a new wp_query
- get_terms for all custom taxonomies shows invalid taxonomy error
- Change the last separator in the_terms
- Combine Tax Archive and Meta_Query in WP_Query
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Order terms by creation date
- Unable to retrieve any child terms using get_terms
- Importing custom DB table entries as posts with Categories
- Saving custom term value to the database in new table
- Multiple terms not working on taxonomy
- List posts of terms but exclude one term
- list of tags overlay
- Getting Term_id – Taxonomy Metadata plugin
- store an array of all the terms existing
- Get only last child category link of products
- Get Parent Custom Taxonomy Term and Color Div background
- get_the_term_list() display in ul li and remove tag
- Custom field drop down to set the term of the post when published
- Altering term_id and name via $wpdb class
- Can One Taxonomies Terms be Ordered by A Seperate Taxonomy?
- How we retrieve the ‘tags’ and ‘attachment’ of the custom post which is created by wp_insert_post();
- Output ACF field dynamicaly within a taxonomy loop [closed]
- WordPress Two Level Filters on Getting Custom Taxonomy Terms
- Foreach for get_the_terms for hierarchical taxonomy don’t repeat Top Level Terms if contains multiple Second Level Terms
- How can I replace the values in WP_Term?