Expiry May 2026 6 min read

How to Auto-Hide Shopify Products When Their Expiry Date Passes

Selling an expired product isn't just embarrassing — for food, cosmetics, and supplements, it can be a genuine compliance risk. The problem is that Shopify doesn't watch your expiry dates for you. This guide shows how to fix that with one metafield and one workflow.

This happens more than you'd think

A food store sells a batch of protein bars with a best-before date of March 15. Someone orders on March 22. The refund, the apologetic email, the one-star review — all preventable, all painful. The merchant knew the date was there in the product metafield. They just didn't have anything watching it.

This isn't a niche scenario. It happens to supplement stores, cosmetics brands, specialty food retailers, event ticket sellers — anyone whose products have a hard date after which they shouldn't be sold. Manual checking works until your catalogue is 50 products deep. After that, things slip through.

The right tool for this job

Shopify doesn't have native expiry date automation. Shopify Flow can't query products by metafield date (that's a known platform limitation — here's the full explanation). The common workaround is a calendar reminder or a spreadsheet you check weekly. Both work until they don't.

DateCue watches your metafield dates every minute. When an expiry date passes, it changes the product status automatically. No code, no Flow triggers, no cron jobs.

Setting up the metafield

If you don't already have an expiry date metafield, set one up in Shopify admin first. Go to Settings → Custom data → Products and add a new metafield definition:

Once the definition is saved, you can set the date on individual products through the product editor, via Bulk Editor, or by CSV import. DateCue will pick up whichever products have the metafield populated.

Creating the DateCue workflow

In DateCue, create a new workflow and configure it like this:

Metafield: custom.expiry_date
Timing: After the date (0 days)
Action: Change product status → Draft
Filter: Status = Active

The Active status filter is worth explaining. Without it, the workflow would run against every product with the metafield — including ones you've already manually put into draft for other reasons. The filter makes sure DateCue only acts on products that are currently live, so it doesn't interfere with your existing drafts.

Draft vs Archived — which should you use?

The workflow above moves products to Draft, which hides them from your storefront but keeps them editable and recoverable. That's usually the right choice for expiry — the product still exists in your admin, you can view its history, and if you need to reinstate it (say, a new batch arrives), you can publish it again.

If you'd rather have expired products completely off-sale and reflected correctly in sales reports, use Archived instead. Archived products don't appear in the active product list, but they're not deleted — they're moved to a separate view. For regulated industries like food and pharma, archiving can be the cleaner audit trail.

For compliance-heavy use cases, there's a more detailed guide: compliance automation for regulated Shopify products.

Pair it with an early warning

The auto-hide workflow deals with products after they expire. But if you sell food or supplements, you probably want to know before expiry too — either to run a clearance sale or to trigger a reorder.

DateCue lets you run multiple workflows on the same metafield. A second workflow set to "Before the date (14 days)" can add an "expires-soon" tag to feed a clearance collection — or you can set up a staff email alert 30 days before so your buyer has time to reorder.

💡 Products with no expiry date set: DateCue only acts on products where the metafield has a value. Products without an expiry date set are completely ignored by this workflow — so it's safe to apply to your whole catalogue, not just the subset you know has dates.

How quickly does DateCue act?

DateCue checks every minute. So when an expiry date passes, the product will be moved to draft within about a minute. It's not instantaneous to the second, but it's close enough for any practical purpose. No more "sold after expiry" because the product sat live for three days after the date passed.

Frequently asked questions

What's the difference between Draft and Archived?

Draft hides the product from your storefront but keeps it fully editable — you can add new stock, change the date, and republish. Archived is a more permanent off-sale state: the product doesn't appear in your active product list and is treated as discontinued in reporting. For most expiry cases, Draft is easier to manage. For regulated industries where you need a clear audit trail, Archived is the better choice.

What if I have hundreds of products with expiry dates?

That's exactly what DateCue is built for. One workflow covers all products with the metafield set — there's no limit on the number of products it watches. Each plan has a product budget (250 on Starter, 2,500 on Growth, unlimited on Pro), so pick the plan that fits your catalogue size.

Does DateCue work with both date and date_time metafields?

Yes. If you use the date type, DateCue treats the expiry as occurring at the start of that day (midnight). If you use date_time, it fires at the exact time you specify. Use date_time if you need precise timing — for example, if a product should stop selling at noon rather than at midnight.

Can I get notified before a product expires, not just after?

Yes — set up a second workflow on the same metafield with "Before the date" timing. You can add a tag (to feed a clearance collection) or send a staff email alert. See the guide on adding an "expires-soon" tag before expiry for the full setup.

Ready to stop worrying about expiry dates?

Set up the workflow once. DateCue watches your entire catalogue every minute and handles the rest.

Start your free trial

14-day free trial. No credit card required.