I think you should be able to do this with a tax_query in your $args.
I could not test this, and I also dont know how the query behaves with a meta and tax query in one.
But I would start with testing something like this:
'tax_query' => array(
array(
'taxonomy' => 'event_category', // the used taxonomy
'field' => 'term_id', // use ID or slug
'terms' => array( 2136 ), // term ID to exclude
'operator' => 'NOT IN', // "NOT IN" to exclude?, default "IN"
),
),
Some more infos in the offical codex.
Related Posts:
- WP Query with custom Shortcode
- Query multiple custom post types in single loop
- Inject post (from specific category) between posts in Loop
- retrieve thumbnail from post ID of best selling product in category
- How to create a WP_Query to search the Title or Tag?
- Modern Tribe Calendar wp-query with meta query not working at all
- How to display custom field on homepage
- Can an array be used as a meta_query value?
- Display related products with custom output
- How to get to a specific position in wp_query?
- Get category name from custom loop and echo it once
- Why is variable not working on custom sql query using wpdb?
- Create WP_Query to search for posts by their categories or their parent/child categories
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- Custom query, checking values of multiple meta keys
- Is it possible to retrieve all posts with a certain value for metadata?
- unable to use ‘new WP_Query’ in AJAX call
- How to add div blocks after certain set of post
- How to overwrite orderby with add_query_var
- WP_Query: getting posts where custom field exists
- How to display SQL query that ran in WC_Order_Query?
- Post not populating for custom post type based on category selection
- Passing an array into WP_Query as a variable
- WordPress meta_query >= &
- Do not duplicate posts with multiple categories in multiple loops
- Using multiple variables to assign categories to an array
- Display latest post from WordPress Featured Category that is also in X,Y,or Z categories
- How can I modify this code to make the search box include tags and meta
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Is it possible to order posts using multiple meta queries, i.e. show posts from first meta query, then the second?
- wp_Query with mutuplea values returns all posts
- meta_query search names when they have middle initials
- Category Page Displaying all Pages
- Usermeta data unserialize, extract and display in table in WordPress
- Meta query not showing result properly
- wordpress query returning unexpected results
- Query doesn’t display text data with apostrophes
- Efficient way of querying for a “fallback” post?
- How can I display a query in a page?
- Trying to exclude posts from a category on the home page
- Query seems to be duplicated
- Does wp_query and query_posts affect website performance? [duplicate]
- Hide empty categories from get_categories
- Fix incorrect related posts code snippet
- wp_query on search results page showing all results every time
- Show post like this image in my newssite [closed]
- Display all categories (with link) of custom post type – WordPress
- Three different queries on same page
- Exclude a category ID from the following function
- Display featured posts first, then display all others within a specific category in WordPress
- exclude multiple terms using get_terms() function
- How to order WP_User_Query results to match the order of an array of user IDs?
- How to update single value in multi dimensional Post Meta?
- WP_Query | Help me create a search term with an ‘OR’ relation?
- Archive listing of posts by publish year (multiple years)
- Add custom field to attachments in a specific category
- Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?
- WP_Query use for a filter with multiple Taxonomies and Terms
- Put a link to a category round a hard coded A HREF
- How do I dynamically generate args for wp_query?
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Custom page archive query by url var calling page twice on one of my custom queries?
- Any possible way to make $wpdb->get_results() return anything else than array?
- How to query for posts with a null or blank post_name?
- WordPress pagination not working with search page
- Creating a related post section based on similar categories
- Optional Meta Query
- Issue adding sub category programmatically
- Grab posts by multiple categories
- Can we return all category (not post) with Custom Query Filter? [closed]
- Add more button if more 8 items
- how to save selected option in variable for rest api category filter
- Display category name only once inside loop
- WP_Query – How to query all of post types categories
- How to work Woocommerce pagination inside shortcode?
- Wrong Number of Products When Hiding Subcategory Products From Showing In Parent Category
- how to get data from two different table from wordpress database
- WordPress search query, how to modify the sql
- Modify post image in full size
- WP Query. Ordering posts by another post types meta
- Admin backend, show post from a category and exclude the posts from subcategories
- Short code into PHP
- Need Quick Help With Product Category Page
- My query keeps looping infinitely ! how to stop it?
- How to callback custom field text
- WP Query conflict on tag.php and category.php template
- Code that displays images – images get shown multiple times
- Main loop querying current template’s info only in custom category archive pages, not my posts
- Product Category Page in Full Width
- WP query with variables gives no result for specific user
- Changing regular db connection to $wpdb
- XML WP_Query problem in PHP 8.0 and 8.1
- How to limit number of posts in the certain category and exclude the oldest post automatically
- How do I display WooCommerce products in my query to rows of 3?
- child category under correct parent
- AND and OR in my CPT search query depending on checkbox
- External WP_Query call from PHP crashed after version update
- Developing a “fallback” for empty wp_query results based on post dates
- How to allow searching a custom meta key in admin list table?