Main problem with your code is that tax_query should be an array of queries, and not a single query.
$tax_query = array(
array(
'taxonomy' => 'filter',
'terms' => array(30140, 30020, 30008, 29998, 29991, 21458,20197,11986,6614),
'field' => 'term_id',
'operator' => 'NOT IN'
)
);
$query->set( 'tax_query', $tax_query );
Related Posts:
- WordPress tax query use operator LIKE
- tax_query will produce nothing
- Multiple, nested tax_query relation
- Can’t make a tax_query across different post types
- How to write a Tax Query that matches all terms in an array?
- using multiple terms in tax_query
- in_category() and tax_query with custom post type
- OR for a single taxonomy in a tax_query
- simple tax_query intersection
- tax_query will produce nothing
- WordPress tax_query “and” operator not functioning as desired
- Custom Taxonomy and Tax_Query
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- pre_get_posts with tax_query causes empty result
- search query within custom taxonomy term, post title and meta field
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Tax_query not working on multisite
- Query set using tax_query with relation ‘OR’ modifies category object?
- Terms with more than one occurrence have current-menu-item class in menu
- How to combine tax_query and date_query in WordPress
- Specify number of posts in my ‘tax_query’
- Problem with get_posts, tax_query and counting the number of 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*)
- why do drafts return as part of wp_query?
- get complex results set according to category structure
- Dynamically tax_query terms
- WP_Query tax_query problem
- Woocommerce change tax rate programmaticly
- WP_Query with tax_query, order by most ‘matches’
- Empty tax_query array returns an empty array
- Use both meta query and tax query
- Custom taxonomy query not working with switch_to_blog
- tax_query: Order by slug?
- ‘wp’ action hook not firing in admin and login?
- Query custom post type by category slug
- Taxonomy archive showing no results
- ?cat=-1 Indexed Versions Of Homepage
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- How to Filter custom post type by taxonomy?
- Tax Query for custom Taxonomy field
- Tax query in pre_get_posts not working
- More then one menu items are assigned with “current-menu-item” class
- Custom Widget WP_Query problem
- How do I display the grand child items of a taxonomy term?
- How can I hide uncategorized products from search results?
- WP_query – Filter by tax_query and meta_query using multiple select
- How to get the id or url of the image in an image post?
- Tax Query only returns for the first of several terms
- How to exclude a taxonomy from shop & search page wooCommerce?
- exclude product with available tag
- get_posts( $args ) return empty data
- Set both meta_query and tax_query using wp_query->set
- tax_query: Don’t show posts with parent term when they have a corresponding child term applied
- $query->is_main_query() is causing query’s tax_query to be ignored
- Is it possible to add relation between meta_query and tax_query?
- Create alphabetical Pagination for custom taxonomy?
- Custom arguments in WP_Query
- How to restrict search on a certain page to only return results against custom taxonomies?
- Exclude post type with pre_get_posts?
- Hi need update in my terms for other taxonomy
- Order WP_Query by The Order of an Array in Tax_Query
- How To Query For An Empty Taxonomy Field
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- Facing problem with tax_query results
- PHP Warning: Attempt to read property “slug” on bool in tax query
- Display related CPT with custom taxonomy
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- Tax query get first product with attribute value in pre_get_posts
- How to get rid of variations with unspecified attributes
- Can I create a tax query to return posts that match two slugs from same taxonomy
- How to search through all child taxonomies using WP_Query?
- how do you pull data from two taxonomies?
- Sort by an ACF field in a tax_query
- WordPress post_status and meta_query
- posts_per_page in a tax_query
- Tax_Query not working – connecting to second wordpress database
- tax_query not working?
- Getting Custom Posts with Custom Taxonomy
- Optimal way to make tags in tax_query optional?
- Not able to get my custom search result using meta_query and tax_query together?
- in tax_query this Is the code correct? I need to access beginner video posts for different subject
- Error get_posts with Custom Taxonomy and OR relation
- How to display just video post format?
- modifying main query to query for ranges e.g. from 1999 to 2016
- How to show post which has the specific taxonomy terms?
- Woocommerce orderby rand with tax_query not random
- Custom taxonomy and query multi conditions
- Escaping WP_Query tax_query when term has special character(s)
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- WP_Query: Meta_Query with serialized value (or a workaround)
- 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
- Get the tax term in which is a post via wp_query
- Advanced AND tax_query in sidebar with 2 taxonomies
- How to limit posts to 1 from each term with tax_query?
- WP_Query with tax_query not working
- wp_get_object_terms count on taxonomies within an category archive
- Custom query with custom filtering returning incorrect results