Overview
↑ Back to topDiscontinued 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- Upload the
discontinued-products-managerfolder to the/wp-content/plugins/directory - Activate the plugin through the ‘Plugins’ menu in WordPress
- 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 topAccess settings at WooCommerce > Settings > Products > Discontinued Products.
General
↑ Back to top| Setting | Description | Default |
|---|---|---|
| Enable Plugin | Master toggle to enable/disable all discontinued products functionality | Disabled |
| Stock Status Text | Text shown in place of the stock status (e.g. “Discontinued”, “No Longer Available”) | Discontinued |
| Auto-Discontinue Default | When enabled, new products have auto-discontinue checked by default | Disabled |
| Remove Add to Cart | Hide the Add to Cart button on discontinued product pages | Enabled |
Display
↑ Back to top| Setting | Description | Default |
|---|---|---|
| Show Badge | Display a badge overlay on discontinued product images | Enabled |
| Badge Text | Text shown inside the badge | Discontinued |
| Badge Position | Where the badge appears on the image: top-left, top-right, bottom-left, bottom-right | Top Right |
| Badge Background Color | Badge background color | #dc3545 |
| Badge Text Color | Badge text color | #ffffff |
| Greyed-Out Image | Apply a greyscale filter to discontinued product images | Disabled |
Messages
↑ Back to top| Setting | Description | Default |
|---|---|---|
| Global Message | A message displayed on all discontinued product pages. HTML is supported. Can be overridden per product. | Empty |
| Message Position | Where the message appears: Before Add to Cart, After Title, or After Price | Before Add to Cart |
| Message Background Color | Message box background | #fff3cd |
| Message Text Color | Message box text color | #856404 |
| Message Border Color | Message box border color | #ffc107 |
Alternatives
↑ Back to top| Setting | Description | Default |
|---|---|---|
| Show Alternatives | Display alternative product suggestions on discontinued product pages | Enabled |
| Primary Source | Where alternatives come from: Manual selection, Related, Upsells, Cross-sells, or Same Category | Manual selection |
| Fallback Source | Used when no manual alternatives are set | Related products |
| Section Header Text | Heading above the alternatives grid | Consider these alternatives |
| Number of Products | How many alternative products to show | 4 |
| Number of Columns | Grid column layout | 4 |
Visibility
↑ Back to top| Setting | Description | Default |
|---|---|---|
| Hide from Shop | Remove discontinued products from shop and category pages. Direct URLs remain accessible. | Enabled |
| Hide from Search | Remove discontinued products from search results | Enabled |
| Hide from Widgets | Remove discontinued products from WooCommerce product widgets | Enabled |
| Exclude from Sitemap | Remove discontinued products from WordPress, Yoast SEO, Rank Math, and SEOPress sitemaps | Disabled |
Advanced
↑ Back to top| Setting | Description | Default |
|---|---|---|
| Enable 301 Redirects | Redirect visitors from discontinued product pages to an alternative product. Can be overridden per product. | Disabled |
| Custom CSS | Add custom CSS to style discontinued product elements. Available classes: .dpm-discontinued, .dpm-badge, .dpm-discontinued-message, .dpm-alternatives-grid | Empty |
| Export | Download a CSV file listing all discontinued products | Button |
Per-Product Settings
↑ Back to topOn 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- 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
- The plugin registers “Discontinued” as a valid WooCommerce stock status, distinct from “Out of Stock”
- Discontinued products become non-purchasable (Add to Cart is removed), display a badge and optional message, and show alternative product suggestions
- Visibility settings control whether the product appears in the shop, search, widgets, and sitemaps
- Direct URLs to the product remain accessible, preserving SEO value and allowing customers to find alternatives
- If auto-discontinue is enabled for a product, the plugin monitors stock changes and automatically sets the status to “Discontinued” when stock reaches zero
- All status changes are logged to the activity log for auditing
Auto-Discontinue
↑ Back to topWhen 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 topWhen 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 topThe 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 topFilters
↑ Back to top| Filter | Description | Args |
|---|---|---|
dpm_product_is_discontinued | Override whether a product is considered discontinued | (bool, WC_Product) |
dpm_availability_text | Customize the discontinued availability text | (string, WC_Product) |
dpm_discontinued_message | Filter the message shown on the product page | (string, WC_Product) |
dpm_hide_product | Control visibility per product | (bool, int) |
dpm_alternative_products | Customize the alternative products array | (array, WC_Product) |
dpm_badge_html | Customize badge HTML output | (string, array, string) |
dpm_redirect_url | Modify the redirect URL | (string, int, int) |
dpm_should_redirect | Control whether a redirect occurs | (bool, int, string) |
Actions
↑ Back to top| Action | Description | Args |
|---|---|---|
dpm_before_discontinue_product | Fires before a product is discontinued | (int, WC_Product) |
dpm_after_discontinue_product | Fires after a product is discontinued | (int, WC_Product) |
dpm_before_restore_product | Fires before a product is restored | (int, WC_Product) |
dpm_after_restore_product | Fires after a product is restored | (int, WC_Product) |
HPOS Compatibility
↑ Back to topDiscontinued Products Manager is fully compatible with WooCommerce High-Performance Order Storage (HPOS) and WooCommerce Cart/Checkout Blocks.