Launch pricing: Lock in Pro at $79/yr before prices go up View pricing →

Add best-before and use-by dates to your WooCommerce products

If you sell anything that goes off — food, drinks, supplements, cosmetics, pet treats — your customers expect to see a date on it, and you need to stop selling it once that date passes. Core WooCommerce has no field for this. It tracks a price, a stock number and a SKU, but nothing that says “this is best before 14 September.” This guide shows how to add a real best-before date to WooCommerce products, display it with the right label, and have the store act on its own when the date arrives — using the free Sellinor Product Expiration Dates plugin.

Add a date to any product

Once the plugin is active, every product gets an Expiration tab in the Product data panel. Open a simple product, click the tab, pick a date, and save. That single date is now the product’s best-before date — stored as standard product metadata, so it travels with exports and stays put if you ever switch tools.

For variable products, each variation can carry its own date, which matters when a 250ml and a 1L bottle of the same line have different shelf lives. Set a date on the parent and any variation without its own date inherits it; set a date on an individual variation and that one wins. On the storefront the displayed date updates as the shopper switches variation. Full setup is covered in Expiration dates.

If you have a lot of products, you don’t need to open each one. The Products list gets a sortable Expiration column, and you can set dates inline with Quick Edit or apply one shared date to a selection with Bulk Edit — see Getting started. For a one-time bulk load from a spreadsheet, the CSV import/export page takes a file keyed by Product ID or SKU.

Best before vs. use by vs. expires — it’s a label, not a different field

These three terms mean different things, and getting them right matters for both trust and compliance:

  • Best before is about quality. The product is generally still safe after the date but may lose peak flavour, texture or potency. Most shelf-stable foods, supplements and dry goods use it.
  • Use by is about safety. It’s used on perishable, higher-risk items and shouldn’t be passed.
  • Expires is the catch-all many stores prefer for cosmetics, batteries or coupons.

The plugin stores one date per product and lets you decide which word sits in front of it. Under Products → Expirations → Settings → General, set the label text to “Best Before”, “Use By”, “Expires” — or whatever your category and local rules require. There’s no separate “best-before field” versus “use-by field” to wrangle; you pick the label that’s honest for what you sell and apply it consistently.

Control where and when the date shows

By default, enabling frontend display renders the date near the add-to-cart button using your theme’s standard WooCommerce hooks, so it works on classic and block themes without fiddling. Two settings give you finer control:

  • A display threshold shows the date only when the product is within a set number of days of its date. Set it to 0 to always show the date; set it to, say, 30 to keep dates hidden until an item is genuinely close, which suits stores where most stock is months out.
  • The [edfw_expiration_date] shortcode places the date exactly where you want it if your theme uses a fully custom product template. It accepts an optional id attribute for use off the product page and automatically suppresses the plugin’s own placement so the date never appears twice.

Dates display in whatever format you’ve set under Settings → General in WordPress, so a US store can show month-first and an EU store day-first without extra config.

Make the store act when the date passes

Displaying the date is half the job. The other half is making sure nobody can buy something that’s past it. Under the same General settings, choose an automatic expiry action:

  • Hide from catalog — the product drops out of shop pages, category listings and search. Its URL still works so existing links don’t 404, but shoppers can’t browse to it. This is applied immediately on every page load.
  • Set out of stock — the product can stay visible with an “out of stock” label but can’t be added to the cart. This is applied by an hourly background check, so it can take up to an hour to flip after the date.
  • Both — the comprehensive option: gone from the catalog and unpurchasable.

You don’t have to wait for the exact day, either. The days before setting fires the action early — set it to 3 and items go out of stock or hidden three days ahead of their best-before date, giving you a buffer. Full detail lives in Expiry actions.

Crucially, whenever an action is enabled, cart and checkout protection is immediate. An expired item can’t be added to the cart, and if something expires while it’s already sitting in a basket, it’s removed at checkout with a notice — so even in the window before the hourly sweep runs, no one completes a purchase of expired stock. (Variable products only go fully unavailable once every variation has expired; an individual expired variation simply becomes unselectable.)

See what’s coming due

The free Overview dashboard at Products → Expirations rolls this up: stat cards for products with dates, expiring soon, expired, and the stock value at risk in your expiring-soon window, plus a month calendar showing how many products fall due each day. Click a day to see exactly which products expire then. A dashboard widget also surfaces your soonest-expiring products the moment you log in. See Reports & calendar.

When you outgrow one date per product

A single best-before date per product is the right model for most stores. If you receive the same product in repeated deliveries with different dates, you’ll eventually want each delivery tracked separately — that’s batch (lot) tracking, with automatic First-Expired-First-Out deduction, in the Pro add-on. See the batch tracking guide, or read how FEFO stock rotation works on a WooCommerce store. For everyone else, the free plugin’s single-date workflow is all you need to put honest best-before dates on your products and stop selling them when they lapse.

Frequently asked questions

How do I add a best-before date to a WooCommerce product?

Install the free Sellinor Product Expiration Dates plugin, edit the product, open the Expiration tab in the Product data panel, and pick a date with the date picker. Each simple product gets one date; for variable products you set a date per variation, and variations without one inherit a default set on the parent product.

What's the difference between a best-before date and a use-by date?

A best-before date is about quality — the product is usually still safe afterward but may decline in flavour or texture. A use-by date is about safety and should not be passed. The plugin stores a single date per product; you choose which label customers see — 'Best Before', 'Use By', or 'Expires' — under Products → Expirations → Settings → General.

Can I show the best-before date on the product page?

Yes. Enable frontend display under Products → Expirations → Settings → General, set your label text, and the date renders near the add-to-cart area. You can also set a display threshold so the date only appears when the product is within X days of expiry, or place the [edfw_expiration_date] shortcode anywhere in a custom template.

What happens automatically when the best-before date passes?

You choose the action: hide the product from your catalog, set it to out of stock, or both — and you can fire that action a set number of days before the date instead of on the day itself. Whenever an action is enabled, the cart and checkout are also protected, so expired items can't be added and are removed at checkout.

Does this work with variable products?

Yes. Each variation can carry its own best-before date, and variations without one inherit a default set on the parent product. The displayed date updates as the shopper selects a variation. A variable product is only hidden or set out of stock once every one of its variations has expired.

Do I need a paid plan to display best-before dates?

No. Setting a date per product or variation, displaying it with a custom label, auto-hiding or out-of-stocking expired items, cart and checkout protection, the Overview reports calendar, and CSV import/export are all in the free plugin. The Pro add-on adds batch and lot tracking with FEFO, automatic discounts as the date nears, and email digests.

Show best-before dates and stop selling expired stock

Add a best-before date to any WooCommerce product, display it with the label you choose, and let the store hide or out-of-stock items automatically when the date arrives.

See plans & download free

Or read the documentation.