Answer from @g33kgirl is correct but doing so via the Admin API can be technically challenging.
There are two easier ways to manage this other than directly interfacing with the API.
-
Use a metafields app. I know off the top of my head that Accentuate Custom Fields has a built in setting to control the seo/hidden interger flag from a control panel
-
Use the Shopify bulk editor with a metafield URL string like: https://your-store.myshopify.com/admin/bulk?resource_name=Product&edit=metafields.seo.hidden
- or select your Products, then fire up bulk editor, then add the bolded bit to the bulk edit URL
- you’ll need to set the value 1 for any products you want hidden
This field will do the following:
- remove the product URLs from the sitemap.xml structure
- hide the products from internal site search
- add NOINDEX,NOFOLLOW tags to the pages
- leave the pages live
Can I ask why you’re trying to do this? Might be a different/better approach to the same end goal.