简体   繁体   中英

Hide products from Woocommerce REST API

I'm trying to find a way to hide products from the Woocommmerce REST API. I can request certain products using filters, but I'm looking for a way to hide products from the API entirely.

I can modify the output of the API with register_rest_field and register_meta functions, but those add new data.

We are connecting our shop to a 3rd party and it's fetching all products, when we only need a very small percentage of those products. There is nu customization possible on their end, so was hoping to limit the visiblity of products in the API somehow?

You can exclude products but does not look like there is a way to exclude certain products from being returned when listing all products on the site by default.

woocommerce: How to exclude some products with specific tag ID from Woocommerce REST API

https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM