How to query only for products with status “in stock” in WooCommerce? [closed]

That worked great!

Just added this:

        'meta_query' => array(
        array(
            'key' => '_stock_status',
            'value' => 'instock',
            'compare' => '=',
        )
    )      

Thanks!

Leave a Comment