2026年11月13日

2026年11月13日

WooCommerce Inventory Setup: Stock, Backorders and Low Stock Alerts

This article is a localized edition of the Japanese original. Read the Japanese original

With WooCommerce inventory management, you can track the stock quantity of each product, stop sales when an item sells out, and get an email when stock runs low. This article covers the store-wide settings, the per-product settings, when stock goes up and down, and common customizations.

Screen labels and hook names were checked against the WooCommerce source code and its Japanese translation (translate.wordpress.org) as of November 2026.

Store-wide inventory settings

In the admin screen, open "WooCommerce" → "Settings" → the "Products" tab, then click "Inventory" at the top.

Setting What it does Default
Manage stock Check "Enable stock management" to turn on the inventory features Enabled
Hold stock (minutes) How long stock is held for unpaid orders. When the time is up, "Pending payment" orders are cancelled. Leave it blank to disable 60
Notifications "Enable low stock notifications", "Enable out of stock notifications", "Enable backorder notifications" All enabled
Notification recipient(s) Where stock notification emails are sent. Separate multiple addresses with commas The site's administration email address
Low stock threshold When stock falls to this number or below, a low stock notification is sent 2
Out of stock threshold When stock falls to this number or below, the stock status changes to "Out of stock" and a notification is sent 0
Out of stock visibility Check "Hide out of stock items from the catalog" to remove out-of-stock products from the shop page and other listings Disabled
Stock display format Whether the product page shows the remaining stock (always, only when low, or never) Always show

Click "Save changes" when you are done.

Hiding products with "Out of stock visibility" keeps their product page URLs working. If you set sold-out products back to draft, their URLs return 404 and links from search results and other sites break, so for a temporary stockout this setting is easier to work with than drafting the product.

Set stock for each product

On the product edit screen, open the "Inventory" tab in "Product data".

  1. Under "Stock management", check "Track stock quantity for this product"
  2. Enter the current stock in "Quantity"
  3. Choose what happens when the item is out of stock in "Allow backorders?" (the options are in the table below)
  4. If needed, enter a per-product value in "Low stock threshold" (if left blank, the store-wide value is used)
  5. Click "Update"
"Allow backorders?" option Behavior when out of stock
Do not allow The product cannot be bought once stock runs out
Allow, but notify customer Orders are accepted, and the product page and other places show "Available on backorder"
Allow Orders are accepted (no backorder notice is shown)

Products without "Track stock quantity for this product" checked are not counted; you manage them by switching "Stock status" (In stock, Out of stock, On backorder) by hand.

"Sold individually" ("Limit purchases to 1 item per order") limits each order to one unit of the product. It is separate from the stock quantity.

Variable products (variations)

For a variable product, if you manage stock in the parent product's "Inventory" tab, that quantity is shared by every variation that does not manage its own stock. To keep separate stock per color or size, go to the "Variations" tab, check "Manage stock" for each variation and enter its quantity.

When stock goes down and comes back

Stock does not change the moment an order is placed. It changes when the order status changes.

When What happens to stock
An order is created at checkout Stock is held for the "Hold stock (minutes)" period so that nobody else can buy the same units
Payment completes, or the status becomes "Processing", "On hold" or "Completed" Stock is reduced (only once per order)
The status goes back to "Cancelled", "Pending payment" or "Failed" The reduced stock is restored

When stock is reduced, the order notes record "Stock levels reduced:" followed by the product name and the before → after quantities, so check the order notes when your counts do not match.

Customize the stock notifications

Low stock and out of stock notifications do not appear in the WooCommerce "Emails" settings list, so change their recipients with "Notification recipient(s)" above or with a filter. Put the following code in your child theme's functions.php or in a PHP file in wp-content/mu-plugins/.

<?php
// Change the recipients of the low stock and out of stock emails
add_filter( 'woocommerce_email_recipient_low_stock', function ( $recipient, $product ) {
	return 'stock@example.com, admin@example.com';
}, 10, 2 );

add_filter( 'woocommerce_email_recipient_no_stock', function ( $recipient, $product ) {
	return 'stock@example.com, admin@example.com';
}, 10, 2 );

To change the low stock threshold by category, use woocommerce_product_get_low_stock_amount, the filter applied when a product's value is read. It replaces the value only when the per-product value is empty, so values entered on the edit screen take priority.

<?php
// For products in the "food" category, use a low stock threshold of 20 when no per-product value is set
add_filter( 'woocommerce_product_get_low_stock_amount', function ( $amount, $product ) {
	if ( '' === $amount && has_term( 'food', 'product_cat', $product->get_id() ) ) {
		return 20;
	}
	return $amount;
}, 10, 2 );

When a variation has no value of its own, the parent product's value is used, so assigning the category to the parent product also covers its variations.

Check and update stock with WP-CLI

WooCommerce has WP-CLI commands (wp wc) that handle the same fields as the REST API. You must specify the user to run them as with --user.

# Enable stock management for product 123 and set its stock to 100
wp wc product update 123 --manage_stock=true --stock_quantity=100 --user=admin

# Show the stock quantity of product 123
wp wc product get 123 --field=stock_quantity --user=admin

# List out-of-stock products (the default is 10 per page, so raise it)
wp wc product list --stock_status=outofstock --fields=id,name,stock_quantity --per_page=100 --user=admin

# Set the stock of variation 201 of variable product 200 to 30
wp wc product_variation update 200 201 --manage_stock=true --stock_quantity=30 --user=admin

To check all products at or below their threshold at once, run wp eval as follows. It respects both per-product and store-wide thresholds and includes variations.

wp eval 'foreach ( wc_get_products( array( "limit" => -1, "type" => array_merge( array_keys( wc_get_product_types() ), array( "variation" ) ) ) ) as $p ) { if ( true === $p->get_manage_stock() && $p->get_stock_quantity() <= wc_get_low_stock_amount( $p ) ) { echo $p->get_id() . "\t" . $p->get_name() . "\t" . $p->get_stock_quantity() . PHP_EOL; } }'

This loads every product, so it takes time on stores with many products. In the admin screen, you can also filter out-of-stock and low-stock products under "Analytics" → "Stock".

Things to watch

  • Back up the database before bulk stock changes or connecting an external system.
  • If you allow backorders, tell customers the expected restock timing on the product page or in emails to cut down on inquiries.
  • If you enable stock management later, existing products have no stock quantity. Set "Track stock quantity for this product" and the quantity for each product.

The overall WooCommerce setup is covered in WooCommerce initial setup.

Questions about WordPress? The publisher of this site is based in Japan and replies in Japanese. Contact (Japanese)

お気軽にご相談ください

お見積りへ お問い合わせへ
▲