Remove Catalog Visibility Hidden Products In WooCommerce From Search & WP REST API Results

Woo doesn’t filter out products with hidden catalog visibility outside of main shop loop. This is important to remember when using the REST API for front end display or general search results. This code snippet will keep them from showing outside of the admin.

https://gist.github.com/ChrisFlannagan/f79ab49491c2b85b0925c66a7fe971fd

Leave a Reply

Your email address will not be published. Required fields are marked *