I’m not sure how you set up looks, but it does seem that you have a lot of taxonomies registered to your post type, so I don’t think it will be very viable to use the the exclude parameter in get_terms()
to exclude the specific term.
What I would suggest is, inside your foreach
loop before you declare your query arguments, add the following line
if ( $term->slug == 'featured-products' )
continue;
This will skip the specific term from being queried. You should also delete the second array inside your tax_query
where you exclude the featured products term. This will ensure that you still get featured products under the other terms
Just a note, your query is quite expensive and you are hitting the db quite hard. I would suggest that you look at caching the results to optimize the query. You can also have a look at transients
Related Posts:
- tax_query shows no results if nothing is selected
- get complex results set according to category structure
- Tax_Query using WP_Query not working
- wp_query with meta_query and tax_query
- list all post who have mutual taxonomy as current taxonomy!
- Why pagination is not working with tax_query param?
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Nested meta_query with multiple relation keys
- Multiple relationship for multiple tax_query in WP_Query
- WordPress tax_query “and” operator not functioning as desired
- Custom Taxonomy and Tax_Query
- Escaping WP_Query tax_query when term has special character(s)
- Tax_query terms ID’s using variable
- Why is my WP_Query not working when tax_query terms are an array?
- WP_query taxonomy + get all posts with two terms from same taxonomy
- SQL Statement generated by WP_Query not producing expected results
- Custom archive page based on array of categories and tags
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- How to combine tax_query and date_query in WordPress
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- Using tax_query reverses my post_type argument in a custom WP_Query
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- Find all product that contain terms with %keywords% in WP_Query
- Get term by custom term meta and taxonomy
- WP_Query tax_query problem
- How to add terms to my tax_query based off of the current post
- Query all posts in a given taxonomy
- Get image of latest post from taxonomies/categories
- Change default ordering of taxonomy terms – pre_get_terms
- WP_Query, tax_query and term_meta: How to?
- Is it possible to dynamically get queried term AND taxonomy?
- Empty tax_query array returns an empty array
- How can i simulate “taxonomy__in” in query?
- Query Custom Post Type Order By Taxonomy Field
- Get list of terms that have posts in another term
- Shortcode to show thumbnail and link for 3 random posts
- pre_get_posts Remove tax_query Completely
- tax_query: Order by slug?
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Meta Query relation “AND” not working
- Nested tax_query that allows specified categories OR tags, but NOT other categories
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- Populate tax_query terms parameter with post term
- Fastest way of counting posts of a custom post type in a specific taxonomy term?
- Is it a good idea to improve meta query performance by adding tax query?
- WP_Query | Tax_Query Relation | Unable to use ‘OR’ as it then allows all products, help me finish my query?
- Tax query AND/OR meta query [duplicate]
- Combining categories (Query posts with multiple taxonomy terms)
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Automatically Query Parent Taxonomy
- Query most popular terms by taxonomy over 2 week period
- Query with meta_query and tax_query together not working properly
- Custom taxonomy.php not working
- Adding a tax_query to a WP_Query Object
- Finding WordPress Posts assigned to multiple categories
- get all posts associated with a custom taxonomy
- Order or Orderby in tax_query (How to define order of terms in WP_Query)
- Tax Query only returns for the first of several terms
- How to add tax_query to $args with concatenation
- How to print term name inside wp post loop
- Get posts in taxonomy randomly
- Loop posts based on permalink term
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- How to restrict search on a certain page to only return results against custom taxonomies?
- Function using get_posts() with tax_query not working when called from functions.php
- WP_Query tax_query – Show results if child has parent X
- Show multiple tax_query from 2 or more post_type in a single code
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- Any quicker alternative for WP_Query “NOT IN”
- Tax Query on product_cat using NOT IN as operator does not exclude that category
- Display related CPT with custom taxonomy
- WP_Query for a taxonomy value OR a custom post type meta field
- Select multiple categories with is_tax
- Query child posts with tax query on parents
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- WordPress tax_query ignoring relation OR
- Optimal way to make tags in tax_query optional?
- in tax_query this Is the code correct? I need to access beginner video posts for different subject
- Combine Tax Archive and Meta_Query in WP_Query
- Taxonomy Terms That Don’t Exist Display Results
- display all posts from category with and without terms in chronological order
- How can I get all the posts that are related with a specific taxonomy term?
- Woocommerce orderby rand with tax_query not random
- How to combine nested tax_query logic with other nested query logic?
- Object of class WP_Query could not be converted to int inside shortcode
- tax_query not working for taxonomy slug
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Custom query for tag and custom tag from 2 post type
- Multiple tax_queries: display posts titles from several custom taxonomie
- Escaping WP_Query tax_query when term has special character(s)
- How to get hierarchical number of custom taxanomy
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- tax_query showing no results
- WP_Query on “property” in the options table
- Query posts filter not working
- Incorrect taxonomy ID assigned to post with custom query
- Custom query for certain post type OR another post type with a certain category
- Custom query with custom filtering returning incorrect results