How to Auto-Archive Sold Out Products in Shopify After 30 Days

Your Shopify store catalog tells a story, but not every chapter needs to stay on display. Products that have been sold out for weeks create digital clutter that confuses customers and makes your active inventory harder to find.

Most store owners face the same dilemma: manually checking which products have been out of stock for 30 days or more can take hours every month. You end up with a catalog full of unavailable items that frustrate shoppers and dilute your brand’s appeal.

The good news is that you can automate this entire process, keeping your storefront clean without manual work. By setting up automatic archiving for products that have been sold out for 30 days, you maintain a focused catalog that showcases only what customers can buy.


TL;DR: Skip the manual setup

Get this two-part automation working in minutes.

MESA Template ID

shopify-archive-out-of-stock-products

Step-by-step guide: How to automatically archive Shopify products that have been sold out for 30 days

Time needed: 10 minutes

This Shopify automation consists of two connected workflows that work together to monitor your Shopify store and automatically archive products that remain sold out for 30 consecutive days. The first workflow captures sold-out events in real-time, while the second workflow runs daily to check durations and handle archiving.

Important: You need both workflows active for this system to work properly. The data collection workflow creates the tracking database that the archiving workflow depends on.

  1. Set up the data collection workflow trigger

    Configure the first workflow to trigger whenever any product variant goes out of stock in your Shopify store. The real-time trigger captures every sold-out event immediately.Set up the data collection workflow trigger

  2. Retrieve product and shop details

    When a variant goes out of stock, the workflow fetches the complete product information from Shopify and retrieves your shop details. You need the shop information to construct proper admin links for easy product management later.Retrieve product and shop details

  3. Calculate total product inventory

    Next, use the Loop built-in tool to sum up inventory quantities across all variants of the affected product to determine if the entire product is truly out of stock. This prevents archiving products that still have available variants in different sizes, colors, or configurations.Calculate total product inventory

  4. Filter for completely sold-out products

    Only products with zero total inventory across all variants proceed to the tracking database. This filter ensures you’re only monitoring products that are completely unavailable, not just individual variants.Filter for completely sold-out products

  5. Create tracking database record

    For qualifying sold-out products, the workflow creates or updates a record in the “Sold Out Shopify Product Tracker” database. This record includes the product ID, title, inventory quantity (0), sold-out start date, day counter (starting at 0), status (Active), and a direct admin link.Create tracking database record

  6. Turn on this tracking workflow

    Be sure to turn this “On” so any out-of-stock event starts tracking.Turn on to auto-archive sold out products in Shopify after 30 days

  7. Set up daily monitoring schedule

    This is the trigger for the second workflow for this solution to work. Configure this step to run every day at midnight using a schedule trigger.Set up daily monitoring schedule

  8. Process active tracking records

    Next, use the built-in Data tool and choose the Query action to search for products with “Active” status in order to process each one individually. Use the built-in Filter tool to check for products.Process active tracking records

  9. Loop through all products to update the tracking counter

    For each active product, get the product details, then calculate the total inventory quantities.

    This ensures the workflow only archives products that have been continuously sold out for 30 days, not products that have been intermittently out of stock. If a product gets restocked even once during the 30-day period, the counter resets and the countdown starts over.Loop through all products to update the tracking counter

  10. Define the rules to increment the counter values

    Next, use the built-in Paths tool to create conditional logic for incrementing the tracking counter.

    For products still at zero inventory, it increments the day counter. For products back in stock, it resets the tracking data.Define the rules to increment the counter values

  11. Identify 30-day candidates

    After updating all counters, use the Data built-in tool and the Query action to find products that have reached exactly 30 days of being sold out. These products meet your archiving criteria and will be automatically removed from your active catalog.Identify 30-day candidates

  12. Archive products in Shopify

    For each product sold out for the full 30-day period, the workflow changes the product status to “archived” in your Shopify store. This removes products from customer view while preserving all data for potential future reactivation.Archive products in Shopify

  13. Update tracking records

    The final step marks archived products in your tracking database with an “Archived” status and records the exact archiving timestamp. This maintains a complete audit trail of your automated inventory management decisions.Update tracking records

  14. Activate both workflows and test

    Turn this workflow On in MESA and test the workflows. First, manually mark a product as out of stock to verify the data collection workflow creates proper tracking records. Then run the daily workflow manually to confirm it processes records correctly before letting both run.Activate both workflows and test


Ready to implement this inventory management workflow?

Use this pre-built template instead of building everything from scratch:

MESA Template ID

shopify-archive-out-of-stock-products

Tips on archiving sold-out products on Shopify

1. Set the right time threshold for your business

Choose your archival timeframe based on your restocking patterns and customer expectations. Fashion retailers might archive after 14 days since trends move quickly, while specialty equipment stores may wait 60-90 days for seasonal restocks. The 30-day standard works well for most general merchandise, but align your timeline with your actual inventory cycles.

2. Create clear archive criteria beyond just sold-out status

Don’t archive every sold-out item automatically. Set up your automation to check multiple conditions like zero inventory, no incoming purchase orders, and specific product tags or collections. This prevents accidentally archiving limited-edition items you’re planning to restock or seasonal products that should return next year.

3. Preserve SEO value by redirecting archived product URLs

When you archive products that had strong search rankings or inbound links, set up automatic 301 redirects to similar active products or relevant collection pages. This maintains your SEO equity and prevents customers from hitting dead ends when they click old bookmarks or search results.

4. Send notifications before archiving high-value product items

Configure your automation to alert you before archiving products above a certain price threshold or those with significant sales history. This gives you a chance to manually review valuable items and decide whether to reorder, find alternative suppliers, or create backorder options instead of archiving.

5. Maintain archived product data for reporting/reactivation

Keep detailed records of archived products, including sales history, profit margins, and supplier information. This makes it easy to unarchive and restock successful items later while maintaining historical data for business analysis and tax purposes.

Why automatically archive sold-out products in Shopify

Keep your bestsellers visible

When sold-out products crowd your collections, customers struggle to find what they can actually buy. A cluttered catalog buries your top performers under unavailable inventory. By automatically removing products that have been out of stock for 30 days, you highlight items customers can purchase right now.

Prevent customer disappointment loops

Nothing frustrates shoppers more than browsing through products only to discover they’re unavailable at checkout. This creates negative shopping experiences that stick with customers long after they leave your store. Auto-archiving eliminates these dead-end product pages before they become conversion killers.

Reduce decision fatigue for seasonal businesses

If you run a seasonal business or sell limited-edition items, old sold-out products can create confusion. Customers spend mental energy evaluating products that aren’t even available, making it harder for them to focus on your active inventory. This is especially problematic during peak shopping seasons when quick decisions matter most.

Maintain clean analytics and reporting

Sold-out products skew your product performance reports and search analytics. When unavailable items appear in your top-viewed products, you get false signals about what customers actually want. Auto-archiving after 30 days ensures your data reflects real customer interest in purchasable products.

Try this related workflow template: 

MESA Template ID

remove-shopify-draft-orders-after-30-days

Improve site search functionality

Your internal search becomes less effective when it returns mostly sold-out results. Customers lose confidence in your search feature and may abandon their shopping session entirely. Removing long-term out-of-stock items keeps search results relevant and actionable.

Signal fresh inventory to return visitors

Repeat customers notice when your product catalog stays static with unavailable items. Auto-archiving creates the impression of active inventory management and regular restocking, even when you’re not adding new products. This subtle signal suggests your business is thriving and well-maintained.

Frequently asked questions

Does Shopify have a feature to auto-archive sold-out products? 

No, Shopify doesn’t offer a native feature to automatically archive products after they’ve been sold out. While you can manually archive products, you’ll need a third-party solution like MESA to create time-based automation that monitors inventory levels and automatically archives products that have been sold out for 30 days or longer.

Can I track how long a product has been out of stock in Shopify? 

Shopify doesn’t provide built-in tracking for out-of-stock duration. The platform shows current inventory levels but doesn’t maintain a log of when products went out of stock or how long they’ve remained unavailable. To track this information and trigger automated actions based on out-of-stock duration, you’ll need an automation platform like MESA that can monitor inventory changes over time and execute workflows based on specific timeframes.

What’s the difference between archiving/deleting Shopify products? 

Archiving products in Shopify removes them from your storefront and search results while preserving all product data, including order history, analytics, and SEO settings. Archived products can be easily restored if inventory becomes available again. Deleting products permanently removes all data and cannot be undone. For sold-out items that might return to stock, archiving is the safer choice since it maintains your product’s search rankings and historical data while keeping your active catalog clean.

How often should I clean up sold-out products from my Shopify store? 

Most successful store owners archive products after they’ve been sold out for 30 days. This timeframe gives you enough opportunity to restock popular items while preventing your catalog from becoming cluttered with unavailable products. Some businesses prefer 14 days for fast-moving inventory or 60 days for seasonal items. The key is consistency—manual cleanup becomes overwhelming, which is why automated archiving through tools like MESA helps maintain a professional storefront without constant manual intervention.

What you should do now

Whenever you’re ready…here are 4 ways MESA can help you get more done:

  1. Sign up for MESA. The best way to get started is sign up for MESA today. Every plan includes the first 7-days free so you can be assured your workflow is running properly.
  2. Browse pre-made templates. Our customizable workflow templates are a great way to get started more quickly.
  3. Talk to our automation experts. If you need help personalizing any workflow template, guidance how to make any automation or, simply want us to make your workflow, we can help.
  4. If you know another merchant who’d enjoy reading this page, share it with them via LinkedIn, YouTube, Twitter, or Facebook.

How to Auto-Archive Sold Out Products in Shopify After 30 Days

Pre-Built Template + Expert Help

Choose this proven workflow template or get custom automation built by our team. 7 days free.

Try this template risk-free
background: abstract lines

Accelerate your work with AI automation.

Build AI agents in minutes that integrate, automate, and simplify your business.

Try MESA for free, 7-day trial included.