Automatically sets WooCommerce products to “Draft” status when their stock reaches zero. Includes a manual admin page to run cleanup.
Features
- Automatic Drafting: After checkout, any product in the order with zero stock is set to draft.
- Manual Cleanup: Admin page to scan all products and draft any that are out of stock.
Installation
- Download or clone this repository.
- Upload
auto-draft-out-of-stock.php
to your WordPress site’swp-content/plugins/
directory. - Activate the plugin from the WordPress admin panel.
Usage
- Products will be automatically set to draft after checkout if their stock is zero.
- To manually run the cleanup, go to the WordPress admin menu and select Out of Stock Draft. Click the button to scan and draft all out-of-stock products.
Requirements
- WordPress with WooCommerce installed and active.
- User must have
manage_woocommerce
capability to access the admin page.
License
GPL v2 or later. See LICENSE.