That worked great!
Just added this:
'meta_query' => array(
array(
'key' => '_stock_status',
'value' => 'instock',
'compare' => '=',
)
)
Thanks!
Related Posts:
- Cluster WooCommerce products in each Category Archive by Tags assigned to products
- WP_Query Taxonomy categories filtering
- Hide products in uncategorized category from search results
- How to echo woocommerce category name
- What code to use in an array to call the current sub-category?
- Get categories within specific term
- Exclude or Include category ids in WP_Query
- WP_Query: Exclude hidden products from WooCommerce product list
- WP_Query to show post from a category OR custom field
- Display recent posts from the same category as current post in sidebar
- Changing a theme’s search function to only show results from woocommerce?
- Counting number of posts with Category B in Category A
- Use Transient API to cache queries for all posts in all categories?
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Retrieve products with specific attribute and in category – woocommerce
- How to combine tax_query and date_query in WordPress
- how to retrieve specific product attribute value in an sql query?
- Display featured products through custom loop in WooCommerce 3 [closed]
- wp_query display posts from same category of the post
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- get complex results set according to category structure
- Get product list of given category
- How to exclude products by tag from woocommerce shop page?
- How to select posts from one category but exclude posts in another category?
- WooCommerce Only OnSale Products Loop Snippet [closed]
- How can you get first post, last post and post count in a category?
- How to get the WC_Product Object when using a WP_Query in WooCommerce
- merge two query arguments into one WP_Query call
- Woocommerce returns Product post_status as published even tho it is in status draft
- List of the years with posts presented
- Take all produts by category
- How to get all product attributes for filters in WooCommerce?
- Category applied to pages, creates multiple breadcrumb entries after a search query (On the translated site)
- Can we return all category (not post) with Custom Query Filter? [closed]
- Extend product search with meta in WooCommerce
- Query posts from category A, and from either category B or C
- Woocommerce – Changing the order of the upsell products [closed]
- Combining categories (Query posts with multiple taxonomy terms)
- Filtering out child category posts from parent category archive not working
- Exclude Category filter from Portfolio section
- Redirect to another page using contact form 7? [closed]
- Limiting number of related posts
- Category ‘pad_counts’ & ‘parent’ conflict
- Woocommerce – exclude only older out-of-stock items
- How to query woocommerce product by pricing? [closed]
- Include posts from some categories while excluding from others
- How to order WP_Query to group results?
- Redirect Search to Form When No Product Results Are Found
- Woo Commerce using WP_Query to get products that match price range, with an additional required product attribute
- How to load a script code only in posts?
- Woocommerce: order posts by meta key
- Slider won’t work with custom query
- WP_Query with one category in args shows other categories
- How order posts from category by date and comment count?
- WP_Query for products always returns empty
- Get the child category ID of current category
- Related Posts Excluding Certain Categories
- Unlimited Page Sitemap Link
- Filter sub-category from checkbox form
- `offset` WP_Query argument dont work via `pre_get_posts`
- Use get_cat_ID to retreive multiple category IDs
- Function the_posts_pagination() not compatible with WP_Query arguments
- adding pagination to a foreach loop in wordpress
- Make a products only viewable to a specific user ID in meta_query pre_get_posts
- ElasticPress is (aparently) messing with my search filters
- Woocommerce Get Orders By Meta Value
- Save large WP_Query to transient === false
- 3 posts from each existing category on one page
- Custom Woocommerce Product Query
- How to display the category dropdown auto search list when key press?
- How to show specify category template for both parent and child category
- How to display Woocommerce products list by tag
- Exclude parent categories from recent posts list
- Woocommerce featured products query no longer working
- Ajax buttons not working properly in WooCommerce when using wc_get_template_part
- Check the product in the cart from which category is and show message
- WP_Query showing all posts, except from category X, unless it’s also in Y
- Not able to fetch woocommerce variation sales products for particular category products
- Multiple values in WP_Query : category__and
- How to exclude posts by ID within a category/archive loop
- I have 3 categories, i want to display on a loop the last 3 of every category
- Get posts with any value in attribute
- Adding Category in WP_Query Not Working
- WP_Query to Retrieve Posts from WooCommerce Products that are Only in Catalog
- Making Woocommerce optimized for more than 500k products
- display all posts from category with and without terms in chronological order
- Pull posts from all categories if quantity is not met?
- Category Archive not working for pages
- Using the same WP_Query for shop and widgets in WooCommerce shop
- Retrieving category pages from subcategory returns empty sets
- Display Count of posts
- Display post list within category list sorted by name [duplicate]
- query_posts problem – need help
- Adding arguments to WooCommerce Product Loop using AJAX
- Main loop querying current template’s info only in custom category archive pages, not my posts
- Filtering product search results using tags
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- I need to get all categories from a WP_Query
- How to get post taxonomy url and name in wp_query
- WP_Query (or WC_Product_Query) out of memory