
In a recent Business Bloomer Club discussion, a member sought guidance on refining a WooCommerce product query. Initially, they successfully used WP_Query
to fetch products but wanted to add filtering based on specific taxonomies, specifically the “3c” category and the “apple” tag.
Members suggested alternative methods, including the WooCommerce-specific wc_get_products
function, which offers a streamlined approach for querying products.
Here, we’ll explore how to use both WP_Query
and wc_get_products
to filter products by category and custom labels.