Description
Some things should not be sold after a certain date: food has a best-before date, a licence or a warranty covers a fixed period, and an event ticket is worthless the morning after. WooCommerce has no way to say so.
PluginCity Product Expiry Dates for WooCommerce adds an Expiry tab to every product with one box on it: the date it can no longer be sold after. When that moment passes the product comes off sale on its own, and a cart that already held it cannot be checked out.
The date is enforced in both places it has to be: a product past its date cannot be added to a cart, and a cart that already held one cannot be checked out — a cart easily outlives the date it was filled before. The customer is told which product to take out, by name.
What you get
- One expiry date per product, on an Expiry tab just below Inventory
- An Expires column on the products list, showing what has stopped selling
- The product taken off sale once the date passes, with a sentence on the page saying why
- Carts that outlived the date refused at the checkout, naming the product to remove
- Notices on the cart, checkout and mini-cart, in the classic checkout and the blocks
- PayPal express buttons refused too, so a one-tap order cannot get past the date
- A shortcode,
[pexp_message], to put the message anywhere - Settings import and export, to copy a configuration to another shop or keep a backup
- High-Performance Order Storage compatibility
The free version is permanent. It does not expire, needs no licence key, and never contacts PluginCity.
Pro
Not every product goes off all at once, and not everyone who buys from you is a retail customer. Pro is for shops that need the exceptions: trade accounts that may still buy cleared stock, a shelf life that dates products for you, dates per variation and in bulk, a warning before a date passes, and an automatic markdown as it approaches.
Pro is a separate paid version, sold and distributed by PluginCity. It is not included in this plugin and is not downloaded or installed by it, and nothing described above depends on it. Your dates and settings carry over if you buy it.
Configuration
- Turn expiry dates on.
- Edit a product, open its Expiry tab below Inventory, and type the date it can no longer be sold after.
- Write the message customers see, and choose whether it appears on the cart, at checkout, or both.
Screenshots






Installation
WooCommerce must be installed and active first.
- In WordPress, go to Plugins Add New.
- Search for PluginCity Product Expiry Dates for WooCommerce.
- Click Install Now, then Activate.
- Go to WooCommerce Product Expiry, or click Settings on the Plugins screen.
From a downloaded ZIP instead: Plugins Add New Upload Plugin, choose the file and click Install Now. There is no need to unzip it.
FAQ
-
How do I stop selling a product after a date?
-
Type the date on the product’s Expiry tab. When it passes, the product comes off sale: the buy button goes and the page says it is no longer available, in your words. Anybody holding it in a cart is asked to remove it before ordering. Orders already placed are untouched.
-
Nothing can be bought through it: the date is checked again when anything is added to a cart, rather than trusted from the page. The button belongs to your theme, and a buy form drawn in place of WooCommerce’s own is hidden too. If yours is still there, tell us the theme and we will look at it.
-
Why is an expired product still sitting in the customer’s cart?
-
WooCommerce would take it straight out and say only that it can no longer be purchased, which reads as a fault in your shop. This plugin leaves the row in place, explains it in your words, and refuses the order until the customer removes it.
-
Neither. It stays listed, so a customer who followed a link lands on a page that explains itself rather than a 404, and nothing can be bought from it. It is not marked out of stock either, which would tell your reports, feeds and back-in-stock emails something untrue.
-
Can I set a time as well as a date?
-
Yes. Leave the time empty and the product sells to the end of the day you typed, as a best-before date reads. Fill it in and it stops at that minute.
-
Can I use it for perishable products with a best-before date?
-
Yes. Type the best-before date on the product’s Expiry tab and it stops selling at the end of that day, so perishable food cannot be added to a cart or checked out past it.
-
Can I stop selling an event ticket once the event has passed?
-
Yes. Give the ticket a date and time and it stops selling at that minute. A cart still holding it cannot be checked out.
-
What time zone are the dates in?
-
Yours, the one set in Settings General. A date you typed stays the moment you meant if you later change the time zone.
-
Not in the free version, which leaves it in the shop and refuses the sale. Pro can hide it from your listings or move it to draft instead. The PluginCity product page lists the Pro features in full.
-
Can different types of product have different shelf lives?
-
Not in the free version. Pro dates products for you from one figure for the shop, or a different number of days for each category — days for salad, years for tins.
-
Can I discount something automatically as its date gets closer?
-
Not in the free version, which leaves your prices alone. Pro can take a percentage off as the date approaches — 20% in the last week, 50% in the last two days — so stock clears instead of being thrown away.
-
Can I be warned before a date passes, rather than finding out afterwards?
-
Not in the free version, which says nothing beforehand. Pro adds a dashboard panel listing what stops selling in the next few days, and can email you the same list each morning.
-
Can I set dates on a lot of products at once?
-
Not in the free version, which gives you one date box per product. Pro adds Quick Edit, Bulk Edit and expiry dates in WooCommerce’s own product CSV export and import. The PluginCity product page has the details.
-
Do variations have their own dates?
-
Not in the free version, where every variation is held to the product’s one date. Pro dates each variation separately, and tells a customer who picks one whose date has passed.
-
Does it work with the block cart and checkout?
-
Yes. A cart holding something past its date is reported through WooCommerce’s Store API, so the block cart and checkout refuse to proceed and show the same message.
-
Can I change the wording?
-
Yes, both sentences: the one on the cart and the one on the product. Bold, italics and links are allowed; anything else is stripped before it reaches the storefront.
-
Can I change how the message looks?
-
The free version draws it one way: a panel with a coloured band and a small clock, taking its type and size from your theme, and it can be restyled with your own CSS. Pro adds controls for colour, box, mark, weight, size and alignment, with a preview.
-
Can I show the cart message somewhere else on my site?
-
Yes. The shortcode
[pexp_message]prints the same sentence wherever you put it, and shows nothing while the cart is fine. -
No. The buttons stay on the cart so the customer can read why, but the order is refused while the cart holds something past its date. A PayPal express button is stopped the moment it is pressed, before the customer is sent out to PayPal, and any other flow that builds its order through WooCommerce’s checkout is refused there too.
-
Does it work with High-Performance Order Storage?
-
Yes. Nothing is written to orders, so HPOS shops are fully supported.
-
What happens if I deactivate WooCommerce?
-
The plugin steps aside and shows a notice. It does not fatally error, and your dates and settings are waiting when WooCommerce comes back.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“PluginCity Product Expiry Dates for WooCommerce” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “PluginCity Product Expiry Dates for WooCommerce” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.2
- The listing now says cart rather than basket, and answers more of the questions shop owners ask.
- Once a customer’s cart has been refused, the settings screen asks once, a week later, for an honest review. Close it and it does not come back.
1.0.1
- Clearer listing text. The plugin works as before.
1.0.0
- First public release.
