Optimized ways of Bulk deleting out of stock Variants (Not products) for40K+ Variants?

Hello Community,

I am working on a store with about 20K products and almost 40K variants. I want to bulk delete out of stock variants to clear up inventory to onboard new retail partners.

I see many apps deleting products in bulk altogether but that’s not my aim. My goal is to keep a product’s variant if it’s stock > 0, else delete that variant. I have already set up an automation using Flow to do so, however Shopify Flow will only do it for future stock changes, whereas currently I can already see a lot of zero stock variants in my client’s store.

For note, the products are being imported, updated etc. through APIs. There is no manual / csv import taking place.

So given my use case, what’s the most efficient way of deleting zero stock variants fast? I don’t mind any writing code to resolve it, but I don’t see any proper bulk variant delete endpoint on Shopify docs, please correct me if I’m wrong. Thank you!

2 Likes

Hi,

This is my go to app for such needs.
https://apps.shopify.com/bulk-product-edit

We have a feature called time travel in our app mesa that you can use to do bulk runs of a workflow. And you could either trigger the flow or do the deletion in mesa.

Hello,

This is something you can do with our Ablestar Bulk Product Editor app. Once you install the app and sync your data you can search for variants that have an inventory less than 1 (to also capture any negative values):

Then on the next page you can choose Delete Variants for the ‘Field to Edit’ and then click on the red button to delete them:

This will delete the variants with an inventory < 1 from the product while leaving the products themselves. Since this is one of the few things in the app that you can’t undo I’d recommend testing with one or two products first before you do the bulk delete. If you have any questions please reach out so nothing gets accidentally deleted.

The app is paid but there’s a free 7-day trial with no limit on the number of products you edit so if this is a one-off thing (which is sounds like) you should be able to do it for free.

Best,

Daniel

Thank you Daniel, sounds nice.
Just to clarify, you mean the filter will select, products which inventory > 0… but some variants fully out of stock, too?
As in, lets say a product X has variants A, B, C.
A = 0 stock
B = 2 stock
C = 0 stock.
I need to only delete A and C.
I hope I am able to explain clearly.
Do you have any filter for that please?

Hi Daniel, I did try Ablestar and all worked well, thank you so much for the recommendation and the delete variant workflow.
Much appreciated.

Hello @SK_TG
I see this is an old post, but I would like to answer for people coming from search. We recently added a new feature to the CS Bulk Delete Products app that allows users to delete out-of-stock variants in bulk. You can follow the following steps.

Step 1: Install the Bulk Delete Products app from the Shopify App Store

Step 2: Click on the Create First Job button

Step 3: Choose Variant Operations

Step 4: Check the out-of-stock variants checkbox and click on the Preview Variants button. You can also filter variants based on product status.

Step 5: On the next screen, you will see the list of variants without stock. If everything looks correct, you can click on the Delete Variants button.