Skip to content

Sunsetvane

Sunsetvane adds a Discontinued switch to WooCommerce products. A discontinued product stays published: its address keeps working, its reviews stay on the page and past orders keep linking to it. It just leaves the shop and cannot be bought any more.

  1. Edit the product and open the Inventory tab of the product data box.
  2. Tick Discontinued at the bottom of the tab.
  3. Optionally pick a Replacement: type part of a product name and choose it. Variations can be picked too.
  4. Click Update.

The switch is per product. For a variable product it stops every variation at once.

To discontinue several products, select them on Products, choose Mark as discontinued in Bulk actions and click Apply. Bring back from discontinued reverses it.

What changes for a discontinued product

Section titled "What changes for a discontinued product"
Where What happens
Shop page, category and tag pages, product search The product is not listed.
Related products and upsells of other products The product is not listed.
Its own page Opens as before (HTTP 200) with the notice "This product is discontinued." and, if set, "Its replacement:" with a link. The add-to-cart form is gone.
Add-to-cart links and the cart WooCommerce refuses to add it. A cart that already holds it drops it at the next cart check.
Structured data on its page The offer availability is https://schema.org/Discontinued.
Orders, reviews, reports Unchanged. The product status stays Published.

The replacement link shows only while the replacement is published and not discontinued itself.

Checked in the WooCommerce 11.3.1 source:

  • Catalog visibility "Hidden" removes a product from the shop, archives, search, related products and upsells, and keeps its address working. Sunsetvane uses exactly this: switching a product on sets its visibility to Hidden and remembers the visibility it had; switching it off puts that visibility back (for example "Search results only").
  • A hidden product can still be bought in core, from its page or through an add-to-cart link. Sunsetvane makes it not purchasable and replaces the add-to-cart form with the notice.
  • Out of stock also stops sales, but the product stays in the shop unless the shop hides every out-of-stock product, and search engines read it as temporarily unavailable.
  • Core has no replacement link, no discontinued label or filter on the products list and no bulk action for it.
  • A discontinued product shows Discontinued next to its name.
  • The filter next to Filter by stock status offers Discontinued and Not discontinued.
  • The Plugins screen has a Discontinued products link that opens the filtered list.
  • Block themes: the notice takes the place of the Add to Cart with Options or Add to Cart Form block in the single product template.
  • Classic themes: the notice takes the place of the add-to-cart form in the product summary (woocommerce_single_product_summary, priority 30).

The notice uses the WooCommerce woocommerce-info style of your theme.

  • One variation cannot be discontinued on its own; use out of stock or disable the variation.
  • If you change the catalog visibility of a discontinued product by hand, it shows in the shop again but still cannot be bought. Switch it off and on to hide it again.
  • Sunsetvane does not redirect the old page to the replacement; the page and its search ranking stay.

WordPress 6.5, PHP 8.1, WooCommerce 8.9 or newer. The plugin declares HPOS compatibility.

Deactivating leaves discontinued products hidden but purchasable again, because the visibility is a WooCommerce setting. Deleting the plugin from the Plugins screen gives every discontinued product back the visibility it had and removes the plugin's three meta values (_sunsetvane_discontinued, _sunsetvane_prior_visibility, _sunsetvane_replacement). There are no options or tables.