Discontinued Products Manager

Overview

↑ Back to top

Discontinued Products Manager lets you mark WooCommerce products as discontinued instead of simply out-of-stock. Discontinued products display a customizable badge, show a message explaining the situation, suggest alternative products customers can buy instead, and can be hidden from the shop, search results, and sitemaps. Direct URLs remain accessible so existing SEO value is preserved.

Installation

↑ Back to top
  1. Upload the discontinued-products-manager folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Navigate to WooCommerce > Settings > Products > Discontinued Products to configure

Requirements

↑ Back to top
  • WordPress 6.4 or higher
  • WooCommerce 9.0 or higher
  • PHP 7.4 or higher

Settings

↑ Back to top

Access settings at WooCommerce > Settings > Products > Discontinued Products.

General

↑ Back to top
SettingDescriptionDefault
Enable PluginMaster toggle to enable/disable all discontinued products functionalityDisabled
Stock Status TextText shown in place of the stock status (e.g. “Discontinued”, “No Longer Available”)Discontinued
Auto-Discontinue DefaultWhen enabled, new products have auto-discontinue checked by defaultDisabled
Remove Add to CartHide the Add to Cart button on discontinued product pagesEnabled

Display

↑ Back to top
SettingDescriptionDefault
Show BadgeDisplay a badge overlay on discontinued product imagesEnabled
Badge TextText shown inside the badgeDiscontinued
Badge PositionWhere the badge appears on the image: top-left, top-right, bottom-left, bottom-rightTop Right
Badge Background ColorBadge background color#dc3545
Badge Text ColorBadge text color#ffffff
Greyed-Out ImageApply a greyscale filter to discontinued product imagesDisabled

Messages

↑ Back to top
SettingDescriptionDefault
Global MessageA message displayed on all discontinued product pages. HTML is supported. Can be overridden per product.Empty
Message PositionWhere the message appears: Before Add to Cart, After Title, or After PriceBefore Add to Cart
Message Background ColorMessage box background#fff3cd
Message Text ColorMessage box text color#856404
Message Border ColorMessage box border color#ffc107

Alternatives

↑ Back to top
SettingDescriptionDefault
Show AlternativesDisplay alternative product suggestions on discontinued product pagesEnabled
Primary SourceWhere alternatives come from: Manual selection, Related, Upsells, Cross-sells, or Same CategoryManual selection
Fallback SourceUsed when no manual alternatives are setRelated products
Section Header TextHeading above the alternatives gridConsider these alternatives
Number of ProductsHow many alternative products to show4
Number of ColumnsGrid column layout4

Visibility

↑ Back to top
SettingDescriptionDefault
Hide from ShopRemove discontinued products from shop and category pages. Direct URLs remain accessible.Enabled
Hide from SearchRemove discontinued products from search resultsEnabled
Hide from WidgetsRemove discontinued products from WooCommerce product widgetsEnabled
Exclude from SitemapRemove discontinued products from WordPress, Yoast SEO, Rank Math, and SEOPress sitemapsDisabled

Advanced

↑ Back to top
SettingDescriptionDefault
Enable 301 RedirectsRedirect visitors from discontinued product pages to an alternative product. Can be overridden per product.Disabled
Custom CSSAdd custom CSS to style discontinued product elements. Available classes: .dpm-discontinued, .dpm-badge, .dpm-discontinued-message, .dpm-alternatives-gridEmpty
ExportDownload a CSV file listing all discontinued productsButton

Per-Product Settings

↑ Back to top

On the product edit screen, the Discontinued tab in the Product Data panel provides:

  • Custom Message: Override the global message for this product (HTML supported)
  • Alternative Products: Select specific products to suggest as replacements
  • Enable Redirect: Override the global redirect setting for this product
  • Redirect Product: Choose a specific product to redirect to (otherwise uses the first alternative)

In the Inventory tab:

  • Auto-Discontinue: Automatically mark this product as discontinued when stock reaches zero

For variable products, auto-discontinue can be set per variation.

How It Works

↑ Back to top
  1. Mark a product as discontinued by changing its stock status to “Discontinued” in the product editor, using the REST API, or via the bulk action in the products list
  2. The plugin registers “Discontinued” as a valid WooCommerce stock status, distinct from “Out of Stock”
  3. Discontinued products become non-purchasable (Add to Cart is removed), display a badge and optional message, and show alternative product suggestions
  4. Visibility settings control whether the product appears in the shop, search, widgets, and sitemaps
  5. Direct URLs to the product remain accessible, preserving SEO value and allowing customers to find alternatives
  6. If auto-discontinue is enabled for a product, the plugin monitors stock changes and automatically sets the status to “Discontinued” when stock reaches zero
  7. All status changes are logged to the activity log for auditing

Auto-Discontinue

↑ Back to top

When auto-discontinue is enabled for a product (via the Inventory tab checkbox), the plugin monitors stock levels. If the stock quantity reaches zero, the product is automatically marked as discontinued instead of “Out of Stock”. The previous stock status is stored so the product can be restored later.

301 Redirects

↑ Back to top

When enabled globally and per-product, visitors who land on a discontinued product page are redirected (301 Permanent) to an alternative product. The redirect target is either:

  • The product specified in the “Redirect Product” field, or
  • The first alternative product from the alternatives list

This is useful for consolidating SEO authority from a discontinued product page to its replacement.

Template Override

↑ Back to top

The alternative products grid template can be overridden in your theme. Copy templates/alternative-products-grid.php from the plugin to yourtheme/discontinued-products-manager/alternative-products-grid.php and customize it.

Deactivation & Reactivation

↑ Back to top
  • On deactivation: All discontinued products are reverted to “Out of Stock” so your shop continues to function normally. Their IDs are stored for potential reactivation.
  • On reactivation: Previously discontinued products are automatically restored to “Discontinued” status.

Developer Hooks

↑ Back to top

Filters

↑ Back to top
FilterDescriptionArgs
dpm_product_is_discontinuedOverride whether a product is considered discontinued(bool, WC_Product)
dpm_availability_textCustomize the discontinued availability text(string, WC_Product)
dpm_discontinued_messageFilter the message shown on the product page(string, WC_Product)
dpm_hide_productControl visibility per product(bool, int)
dpm_alternative_productsCustomize the alternative products array(array, WC_Product)
dpm_badge_htmlCustomize badge HTML output(string, array, string)
dpm_redirect_urlModify the redirect URL(string, int, int)
dpm_should_redirectControl whether a redirect occurs(bool, int, string)

Actions

↑ Back to top
ActionDescriptionArgs
dpm_before_discontinue_productFires before a product is discontinued(int, WC_Product)
dpm_after_discontinue_productFires after a product is discontinued(int, WC_Product)
dpm_before_restore_productFires before a product is restored(int, WC_Product)
dpm_after_restore_productFires after a product is restored(int, WC_Product)

HPOS Compatibility

↑ Back to top

Discontinued Products Manager is fully compatible with WooCommerce High-Performance Order Storage (HPOS) and WooCommerce Cart/Checkout Blocks.

Related Products

Offer add-ons like gift wrapping, special messages or other special options for your products.

Let customers subscribe to your products or services and pay on a weekly, monthly or annual basis.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.