Not sure about the custom taxonomy, however I have used this code before to remove empty categories. You can add it to functions.php.
add_filter( 'wp_get_nav_menu_items', 'nav_remove_empty_category_menu_item', 10, 3 );
function nav_remove_empty_category_menu_item ( $items, $menu, $args ) {
global $wpdb;
$nopost = $wpdb->get_col( "SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE count = 0" );
foreach ( $items as $key => $item ) {
if ( ( 'taxonomy' == $item->type ) && ( in_array( $item->object_id, $nopost ) ) ) {
unset( $items[$key] );
}
}
return $items;
}
Related Posts:
- How to display submenus on page based on referring top-level parent?
- Remove pagination from WooCommerce product categories on admin edit navigation menus
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- Programatically added attribute, set to ‘show on product page’ automatically. Woocommerce [closed]
- Get custom category image from menu
- How to add Post Format Taxonomy Archive page in the menu?
- How to get all taxonomies which can be added in menu?
- woocommerce custom product category template
- Corrupted nav-menu?
- Fill New Taxonomies
- Cloning product not copying custom taxonomies
- How to add all existing Custom Taxonomy to Admin Menu Creations Interface?
- How do you search for a post by custom taxonomy?
- What is the current page’s Taxonomy?
- Display woocommerce product_cat child terms with thumbnails
- How do I check if a post has a term with a particular ancestor/parent?
- WordPress implode & wp_insert_post question
- Get the taxonomy of the post
- how can i display taxonomy instead of category on my web page?
- Taxonomy Meta Box in User Profile?
- How Parent Taxonomy automatically added to the post when using `wp_set_object_terms()`?
- Get posts in certain Taxonomy terms for the current page url
- How to display ACF taxonomy checkbox links on WooCommerce product category archive
- Proper way to update the slug of a taxonomy using register_taxonomy? [duplicate]
- Displaying Custom Taxonomy without a hyperlink
- Get object for a few selected taxonomies
- When filtering query on custom taxonomy; main menu dissapears
- How to add images to taxonomy terms? [duplicate]
- Why get_page_template() doesn’t show taxonomy template file name?
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- How can I create an automatic drop down menu with my tags?
- Edit custom taxonomy description programatically
- Get only immediate children (and not grandchildren) of a hierarchical custom taxonomy term
- Get taxonomy name for the current post
- View the complete list of a taxonomy in the navigation menu
- How to group all terms children’s in custom taxonomy?
- My custom taxonomy page is leading in 404 page
- Show template part if part of term
- one post per term taxonomy
- How can I change the output display of my pagination?
- Hide custom Woocommerce taxonomies when empty
- Exclude product attributes from taxonomy terms loop
- Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
- Adding a custom taxonomy to “nav_menu_item”
- Get name of taxonomies of current page
- Filter through custom taxonomy with an array of taxonomy IDs
- Remove taxonomy widget from “PAGE” post
- Add attribute taxonomy through code don’t appear in admin product page
- List Top 5 taxonomy terms based on number of post
- How to get attached image to taxonomy..?
- Loop through custom taxanomy in post and display custom fields from posts
- How add body_class from wp_termmeta
- How to get list of only custom taxonomies?
- Get list of taxonomies associated with users
- query_posts that have custom taxonomy and limiting what shows based on the taxonomy
- Dropdown taxonomy lists in admin menu
- Same menu for different taxonomies to reach different content
- Register `product_cat` taxonomy for default post post type
- Add custom taxonomy as a css class
- Custom Taxonomy Not Saving in Front End Post
- Taxonomy archive template that shows posts from more than one taxonomy
- Taxonomy page shows category in title
- Taxonomy.php how to show post only in current taxonomy with wp_query?
- Don’t display taxonomy if empty
- Query custom taxonomy for category including children
- Taxonomy Overview Page?
- Taxonomize taxonomy terms?
- Order taxonomy terms wordpress
- Only display latest custom taxonomy post
- How can I get Taxonomy Images to work with ‘orderby’ argument?
- Unable to get the Parent Custom Taxonomy Terms
- How to get the term description in a taxonomy term archive query?
- How to define %category% for custom taxonomies?
- Unsetting post_tag taxonomy breaks term description for other taxonomies
- Taxonomies on Pages with Custom Formatting
- Can I output a custom taxonomy as a submenu in the site navigation menu?
- Use wp_list_categories to list parent categories from actual term
- How to combine taxonomies into URL?
- Why do my quick edits for custom taxonomies not show on the post frontend?
- Amend taxonomy to search in wordpress admin
- Include get_term_link inside search
- Unique taxonomy for post
- Trash Bin for Categories?
- Set two terms for a post when they differ only by an accent
- Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
- Showing custom taxonomy in woocommerce signle product page
- Adding term to a custom taxonomy based on term from product category
- Tracking the name of a custom taxonomy
- Add terms to a taxonomy archive from within the same taxonomy
- Show recent posts from a custom taxonomy in wordpress
- Rewrite Search URL Permalink For CPT Custom Taxonomies
- Warning: Undefined variable $post in C:\xampp\htdocs\… after PHP upgrade
- display taxonomy terms with link
- Admin only taxonomies?
- new custom filed not showing in taxonomy
- How to add a dynamic dropdown derived from custom taxonomy
- Custom field with terms from another taxonomy programmatically
- Taxonomies and subtaxonomies relations
- Retrieve the child terms by having the parent’s information
- Infinite Scroll appending Next Product Category Term pages