Re: Is there any way to unpublish a product from multiple publications?

Is there any way to unpublish a product from multiple publications?

jam_chan
Shopify Partner
920 23 188

Currently, only the online store channel can support bundle products. When I run productUpdate mutation, I get a lot of userErrors: Channel Channel Point of Sale does not support bundle products. Sometimes, it may be other channels like Facebook, Pinterest, or others. It causes the product update to fail

 

How can I unpublish a product from multiple publications at once? I can only find publishableUnpublish mutation. But it can only unpublish a publication at 1 time.

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
Replies 3 (3)

Liam
Community Manager
3108 341 880

Hi Jam_chan,

 

The publishableUnpublish mutation indeed unpublishes a product from one publication at a time. For unpublishing from multiple channels, you would need to run the mutation multiple times, each with a different channel ID. This could be automated using a script that loops over all the channel IDs and runs the mutation for each one.

 

Unfortunately, Shopify does not currently natively support unpublishing from multiple publications in a single mutation - but this is a great suggestion that I'll submit as a feature request. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

jam_chan
Shopify Partner
920 23 188

Thanks for your prompt reply, @Liam. I'm unpublishing one product at a time now. It can work without problems. Just look for a better way without looping. 🙌

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
den232
Shopify Partner
213 8 55

YES!  As of June 2024, publicationId can be an array, like this:

 

{
"id": "gid://shopify/Product/11111111",
"input": [

{
"publicationId": "gid://shopify/Publication/2222222"
},

{
"publicationId": "gid://shopify/Publication/3333333"
},

{
"publicationId": "gid://shopify/Publication/4444444"
}

]
}