WooCommerce does not have a built-in feature to automatically cancel unpaid orders that contain products that are no longer available. However, you can use a plugin like “WooCommerce Order Status Manager” to create a custom order status for unpaid orders that contain products that are no longer available.
Once you have installed and activated the plugin, you can follow these steps to create the custom order status:
- Go to the WordPress dashboard and navigate to “WooCommerce > Order Statuses”.
- Click the “Add Order Status” button.
- Enter a name for the new order status, such as “Cancelled – Out of Stock”.
- Select “Unpaid” from the “Set as Unpaid Order Status” dropdown.
- Click the “Add New Status” button to save your changes.
After creating the new order status, you can use the “WooCommerce Order Status Manager” plugin to create a custom action that will automatically change the status of unpaid orders that contain products that are no longer available.
I hope this helps! Let me know if you have any other questions.