WooCommerce Products and Inventory — Simple, Variable, Grouped and External Products
In this tutorial, you'll learn how to create and manage WooCommerce products — simple, variable, grouped, and external — and configure inventory tracking, stock status, product data tabs, categories, and bulk editing for your WordPress online store.
What You'll Learn
- How to add a new product in WooCommerce from the Products menu
- The four product types: Simple, Variable, Grouped, and External/Affiliate
- How to set up a Simple product with title, description, price, images, and gallery
- How to use product data tabs: General, Inventory, Shipping, Linked Products, Attributes, Advanced
- How to organize products with categories and tags
- How to create Variable products with attributes (size, color) and per-variation pricing
- How to configure Grouped products that bundle simple products together
- How to set up External/Affiliate products with a custom product URL
- How to manage inventory: SKU, stock status, quantity, backorders, low stock thresholds
- How to configure shipping data: weight, dimensions, shipping classes
- How to use upsells and cross-sells to increase order value
- How to import and export products via CSV
- How to bulk edit products for pricing, stock, and categories
Why It Matters
Your products are the heart of your online store. If products are set up incorrectly, customers can't find what they want, can't select options, see wrong prices, or order out-of-stock items. WooCommerce gives you four product types because real stores sell different things: a simple t-shirt (Simple), a t-shirt with size and color options (Variable), a gift bundle (Grouped), and a drop-shipped item sold on another site (External). Choosing the wrong type or misconfiguring inventory causes lost sales, frustrated customers, and time spent fixing mistakes. Getting products right from the start keeps your store running smoothly and your customers happy.
Real-World Use
An online clothing store sells t-shirts, hoodies, and accessories. T-shirts come in five sizes and three colors — each combination must track inventory separately. Hoodies are simple products with one price. Accessories like hats are simple products. The store also sells a "Starter Bundle" that groups a t-shirt, hoodie, and hat at a discount. Some items are drop-shipped from a third-party supplier via affiliate links. With WooCommerce, the store uses Variable products for t-shirts (size + color attributes), Simple products for hoodies, Grouped products for bundles, and External products for drop-shipped items. Each product type fits its use case, and inventory tracking ensures customers never order a sold-out size.
Learning Path
flowchart LR
A[WooCommerce Setup] --> B[Products & Inventory]
B --> C[Payments, Shipping & Tax]
B --> D[Product Categories]
B --> E[Product Images & Galleries]
B --> F[Bulk Product Management]
C --> G[Order Management]
style B fill:#38bdf8,color:#0f172a,stroke-width:2px
Adding a New Product
To add a product, go to Products > Add New in the WordPress admin sidebar.
The product editing screen is similar to the WordPress post editor but includes a Product data section below the main editor. This section contains all the e-commerce-specific fields.
// WooCommerce registers the 'product' custom post type
// It extends WordPress posts with additional meta fields
// You can query products programmatically
$products = wc_get_products(array(
'limit' => 10,
'status' => 'publish',
));
The Product Editor Interface
The product editor has three main areas:
- Top bar: Product title, permalink, status (draft/publish), and visibility settings
- Content area: Main product description (shown on the product page) and short description (shown in archives and emails)
- Product data metabox: All WooCommerce-specific settings organized in tabs
Product Types
WooCommerce supports four product types. Each type changes which fields appear in the Product Data section.
Simple Product
A simple product is a single item with no options. You set one price, one stock count, and one SKU. Examples: a book, a hoodie in one size, a digital download, a single candle.
Variable Product
A variable product has multiple variations with different attributes. Each variation can have its own price, stock, SKU, and image. Examples: a t-shirt in sizes S/M/L/XL, a phone case in colors Red/Blue/Black.
Grouped Product
A grouped product is a collection of simple products sold together. Customers can choose which items from the group to purchase. Examples: a camera bundle (body + lens + case), a skincare set (cleanser + moisturizer + serum).
External / Affiliate Product
An external product links to a product on another website. You set a product URL and button text. WooCommerce does not handle the sale — the customer is redirected. Examples: affiliate products on Amazon, drop-shipped items on AliExpress.
// Check a product type programmatically
$product = wc_get_product(123);
if ($product->is_type('simple')) {
// Handle simple product logic
} elseif ($product->is_type('variable')) {
// Handle variable product logic
} elseif ($product->is_type('grouped')) {
// Handle grouped product logic
} elseif ($product->is_type('external')) {
// Handle external product logic
}
Simple Product Setup
Creating a simple product is the foundation. Master this, and the other types make more sense.
Title and Description
- Enter the Product title (e.g., "Classic Cotton Hoodie - Black").
- Write a Product description in the main editor. This appears on the product page.
- Write a Short description below the main editor. This appears in product archives, search results, and email notifications.
// Set product description programmatically
$product = new WC_Product();
$product->set_name('Classic Cotton Hoodie - Black');
$product->set_description('A comfortable cotton hoodie perfect for everyday wear.');
$product->set_short_description('Premium cotton hoodie, machine washable.');
$product->set_regular_price(49.99);
$product->save();
Product Image and Gallery
The product image is the main photo shown in catalogs. The gallery holds additional images.
- In the Product image box on the right, click Set product image.
- Choose or upload the main image.
- Click Add product gallery images to add additional photos — multiple angles, close-ups, size charts.
Regular Price and Sale Price
Set your pricing:
- Regular price: The standard price (e.g., $49.99)
- Sale price: The discounted price (e.g., $39.99)
- Schedule sale: Click the calendar icon to set start and end dates for the sale
// Set sale price with scheduling
$product->set_regular_price(49.99);
$product->set_sale_price(39.99);
$product->set_date_on_sale_from('2026-07-01');
$product->set_date_on_sale_to('2026-07-15');
Product Data Tabs
The Product Data section is where all e-commerce settings live.
General Tab
- Regular price: The normal selling price
- Sale price: Discounted price
- Tax status: Taxable, shipping only, or none
- Tax class: Standard, reduced rate, or zero rate
Inventory Tab
- SKU: Stock Keeping Unit — your internal product code (e.g., "HOOD-BLK-M")
- Manage stock: Check to enable inventory tracking
- Stock status: In stock, out of stock, on backorder
- Stock quantity: Number of items available
- Allow backorders: Do not allow, allow with notification, or allow without notification
- Low stock threshold: Alert when stock drops below this number
// Set inventory data programmatically
$product->set_sku('HOOD-BLK-M');
$product->set_manage_stock(true);
$product->set_stock_quantity(50);
$product->set_stock_status('instock');
$product->set_backorders('notify');
$product->set_low_stock_amount(5);
Shipping Tab
- Weight: Product weight (e.g., 0.5 kg)
- Dimensions: Length, width, height
- Shipping class: Group this product for shipping rate calculation
// Set shipping data
$product->set_weight(0.5);
$product->set_length(30);
$product->set_width(20);
$product->set_height(5);
$product->set_shipping_class_id(2); // ID of the shipping class
Linked Products Tab
- Upsells: Products you recommend instead of the current product (usually higher-priced alternatives). Displayed on the product page.
- Cross-sells: Products you recommend in addition to the current product. Displayed on the cart page.
Example: A customer views a basic camera ($299). You upsell a pro model ($499). At checkout, you cross-sell a camera bag ($39) and memory card ($19).
// Set upsells and cross-sells
$product->set_upsell_ids(array(101, 102)); // Product IDs
$product->set_cross_sell_ids(array(103, 104));
Attributes Tab
Attributes are the building blocks for variable products. For a simple product, attributes are used for informational display only (no purchase options).
- Custom product attribute: Add a name and value (e.g., "Material: Cotton").
- Taxonomy attribute: Use global attributes shared across products (e.g., "Size", "Color").
- Visible on the product page: Show the attribute in the additional information section.
- Used for variations: Make this attribute available for variation selection (only for variable products).
Advanced Tab
- Purchase note: A note sent to the customer after purchase (e.g., "Care instructions included").
- Menu order: Custom ordering in product archives.
- Enable reviews: Allow customers to leave reviews on this product.
Categories and Tags
Categories and tags help customers find products. They work the same as WordPress post categories and tags.
Product Categories
Create product categories at Products > Categories.
- Categories are hierarchical — you can have subcategories (e.g., "Clothing > T-Shirts > Men's").
- Each category can have an image, description, and display type.
- Assign products to categories in the Product categories box on the product editor.
Product Tags
Tags are non-hierarchical keywords. Use them for attributes that don't fit in categories:
- Material tags: "cotton", "wool", "leather"
- Style tags: "casual", "formal", "sporty"
- Occasion tags: "birthday", "wedding", "holiday"
// Set categories and tags programmatically
wp_set_object_terms(123, array('clothing', 'hoodies'), 'product_cat');
wp_set_object_terms(123, array('cotton', 'casual'), 'product_tag');
Variable Products
Variable products are the most complex but most powerful product type. They let customers choose options that change the price, stock, and image.
Step 1: Create the Variable Product
- Add a new product.
- Select Variable product from the Product Data dropdown.
- Enter the product title and description.
Step 2: Add Attributes
- Go to the Attributes tab in Product Data.
- Add an attribute: Name = "Size", Values = "S | M | L | XL" (separated by |).
- Check Visible on the product page.
- Check Used for variations — this is critical. Without this, the attribute won't create variations.
- Repeat for "Color" with values "Red | Blue | Black".
// Add attributes programmatically
$attribute = new WC_Product_Attribute();
$attribute->set_name('Size');
$attribute->set_options(array('S', 'M', 'L', 'XL'));
$attribute->set_visible(true);
$attribute->set_variation(true);
$product->set_attributes(array($attribute));
$product->save();
Step 3: Generate Variations
- Go to the Variations tab in Product Data.
- Click Add variation dropdown.
- You can:
- Add variation manually: Create one variation at a time.
- Create variations from all attributes: Generate all possible combinations at once.
If you have Size (4 values) and Color (3 values), clicking Create variations from all attributes generates 12 variations.
Step 4: Configure Each Variation
Each variation has its own settings:
- Regular price: Override the base product price.
- Sale price: Discounted price for this variation.
- SKU: Unique SKU per variation (e.g., "TSHIRT-RED-S").
- Stock: Manage inventory per variation.
- Image: Different image per variation (e.g., red shirt photo for red variation).
- Shipping: Different weight or dimensions.
// Create a variation programmatically
$variation = new WC_Product_Variation();
$variation->set_parent_id(123);
$variation->set_attributes(array(
'pa_size' => 'm',
'pa_color' => 'red',
));
$variation->set_regular_price(29.99);
$variation->set_sku('TSHIRT-RED-M');
$variation->set_manage_stock(true);
$variation->set_stock_quantity(15);
$variation->set_image_id(456); // Custom image for this variation
$variation->save();
Step 5: Default Variation Values
Set the default form values. If a customer lands on the product page, what options are pre-selected? Common choices: the most popular size or the first variation.
Grouped Products
A grouped product bundles existing simple products. Customers buy items individually from the group.
Setup
- Create simple products first (each one is a separate product).
- Create a new product and select Grouped product.
- Go to the Linked Products tab.
- In the Grouped products field, search for and select the products to include.
// Create a grouped product
$grouped = new WC_Product_Grouped();
$grouped->set_name('Starter Bundle');
$grouped->set_children(array(101, 102, 103)); // IDs of simple products
$grouped->save();
The product page shows each item in the group with its individual price, quantity field, and add-to-cart button. Customers check out with their selected items in the cart.
External / Affiliate Products
External products redirect customers to another website for purchase. You earn a commission on referred sales.
Setup
- Create a new product and select External/Affiliate product.
- Enter the product URL: the full URL where the product is sold (e.g., https://amazon.com/dp/B0EXAMPLE).
- Enter Button text: what the "Add to cart" button says (e.g., "Buy on Amazon").
- Set the price for display purposes — customers see it before clicking through.
// Create an external product
$external = new WC_Product_External();
$external->set_name('Premium Camera Lens');
$external->set_regular_price(299.99);
$external->set_product_url('https://amazon.com/dp/B0EXAMPLE');
$external->set_button_text('Check Price on Amazon');
$external->save();
WooCommerce does not track the sale or handle payment for external products. The customer leaves your site and completes the purchase on the partner site.
Importing and Exporting Products
For stores with many products, manual entry is impractical. WooCommerce has a built-in CSV importer and exporter.
Exporting Products
- Go to Products > All Products.
- Click Export.
- Select which columns to export (all or specific fields).
- Click Generate CSV and download the file.
Importing Products
- Go to Products > All Products.
- Click Import.
- Upload a CSV file with the required columns.
- Map CSV columns to WooCommerce fields.
- Run the import — WooCommerce processes in batches.
SKU,Name,Regular price,Stock,Type,Category
HOOD-BLK-M,Classic Hoodie Black Medium,49.99,25,simple,Clothing > Hoodies
HOOD-BLK-L,Classic Hoodie Black Large,49.99,30,simple,Clothing > Hoodies
TSHIRT-RED-M,Cotton T-Shirt Red Medium,24.99,50,simple,Clothing > T-Shirts
CSV Import Tips
- Use a tool like Google Sheets or Excel to prepare the CSV.
- The first row must be headers matching WooCommerce column names.
- For variable products, prepare one row per variation with the parent SKU reference.
- Test with 3-5 rows before importing your entire catalog.
Bulk Product Editing
WooCommerce allows editing multiple products simultaneously.
Bulk Edit via Product List
- Go to Products > All Products.
- Select products using the checkboxes.
- Choose Edit from the Bulk Actions dropdown.
- Click Apply.
The bulk edit panel lets you change:
- Price: Set regular price, sale price, increase/decrease by percentage or fixed amount
- Stock: Set stock status or quantity
- Categories: Add or remove categories
- Shipping: Set weight, dimensions, or shipping class
- Tax status: Change tax class for all selected products
// Bulk update prices programmatically
function bulk_increase_prices($percentage) {
$products = wc_get_products(array('limit' => -1));
foreach ($products as $product) {
$old_price = $product->get_regular_price();
$new_price = $old_price * (1 + $percentage / 100);
$product->set_regular_price(round($new_price, 2));
$product->save();
}
}
Quick Edit
Hover over a product in the list and click Quick Edit. This panel lets you change:
- Product name, slug, and description
- Price and sale price
- Stock status
- Categories (if shown)
- Visibility and status
Product Gallery and Images
High-quality product images drive sales. WooCommerce supports:
- Main product image: Shown in catalogs and as the primary image on the product page
- Product gallery: Additional images shown as thumbnails below the main image
- Zoom effect: Customers hover over the image to see details
- Lightbox: Click on an image to view it full-screen
Image Best Practices
- Use consistent image dimensions (e.g., 800x800 pixels)
- Show multiple angles: front, back, side, detail close-up
- Include a size chart image for clothing products
- Use lifestyle images showing the product in use
- Compress images for fast loading — use WebP format if possible
Common Mistakes
Choosing the wrong product type. Beginners often create variable products as simple products, or grouped products as variable products. A t-shirt with sizes is a variable product, not a simple product. A gift bundle is a grouped product, not a variable product. Understanding each type is essential. If you choose the wrong type, you'll either miss features (no variation options) or overcomplicate the setup (creating variations when you just need a simple product).
Not enabling stock management. Without stock management, WooCommerce never tracks inventory. You can sell 100 t-shirts when you only have 20. Enable stock management in the Inventory tab and set accurate stock quantities. For variable products, enable stock management per variation — each size and color combination has its own stock.
Creating too many variations. A product with sizes S/M/L/XL (4) and colors Red/Blue/Black/Green (4) and materials Cotton/Polyester (2) creates 32 variations. Each variation takes time to configure. Customers rarely need that many options. Limit attributes to 2-3 per product. Consider selling different material options as separate products.
Forgetting to check "Used for variations" on attributes. You add Size and Color attributes, save the product, and the Variations tab is empty. The checkbox "Used for variations" must be checked on each attribute. Without it, WooCommerce treats the attribute as informational only and doesn't generate variation fields.
Skipping SKUs and using meaningless codes. SKUs are your internal product identifiers. If you skip them, you can't track inventory across systems, manage warehouse stock, or reconcile sales data. Use a consistent SKU format (e.g., CATEGORY-SIZE-COLOR) so you can identify products at a glance.
Practice Questions
What is the difference between a Variable product and a Grouped product? When would you use each? Answer: A Variable product has attributes (like size, color) where each combination has its own price and stock. A Grouped product is a collection of existing simple products sold together on one page. Use Variable when the same base product has options. Use Grouped when selling a bundle of different products.
If you have a t-shirt with sizes S, M, L, XL and colors Red, Blue, Black, how many variations does WooCommerce generate? Answer: 12 variations (4 sizes x 3 colors). Each variation can have independent pricing, stock, SKU, and image. You would generate them all at once using "Create variations from all attributes" and then configure each one.
Why would you use upsells vs cross-sells? Give an example of each. Answer: Upsells appear on the product page and suggest a better/higher-priced alternative. Example: showing a $499 pro camera when the customer views a $299 basic camera. Cross-sells appear on the cart page and suggest complementary products. Example: showing a camera bag and memory card in the cart after adding a camera.
Challenge: Create a complete product catalog for a small clothing store. Include: 5 simple products (accessories like hats and scarves), 1 variable product (a t-shirt with 3 sizes and 3 colors = 9 variations with unique SKUs and stock), and 1 grouped product (a "Starter Wardrobe" that includes the t-shirt + 2 accessories). Use CSV import to add 20 additional products with categories. Export the entire catalog to verify your data. Test each product type on the front end — verify that variations change price/stock, grouped products show component items, and simple products add to cart correctly.
FAQ
Mini Project
Build a complete product catalog for an electronics accessories store.
- Create 5 simple products: USB-C cable, screen protector, phone stand, power Adapter, car mount. Each with title, description, price, image, SKU, and weight.
- Create 1 variable product: Wireless earbuds with colors (Black, White, Blue) and storage options (Standard, Pro). Configure per-variation pricing: Pro adds $20. Set per-variation stock.
- Create 1 grouped product: "Travel Kit" combining the USB-C cable, power adapter, and car mount at a 10% discount (use the sale price on individual items).
- Create 1 external product: Link to a premium phone case on Amazon with an affiliate URL.
- Organize everything into categories: Cables, Accessories, Audio, Kits.
- Enable stock management for all products. Set low stock threshold to 5.
- Configure upsells: when viewing basic earbuds, upsell the Pro version. When viewing the USB-C cable, cross-sell the power adapter.
- Write a SKU convention document: explain your SKU format so another team member can add products consistently.
What's Next
Now that your products and inventory are configured, let's set up payments, shipping, and tax so customers can actually buy:
Continue to Lesson 47: Payments, Shipping and Tax — Configure payment gateways, shipping zones, and tax rates for your WooCommerce store.
Related lessons:
- WooCommerce Setup — Back to the basics of installing and configuring WooCommerce
- Essential Plugins — Recommended plugins for SEO, security, and performance
- Order Management — Manage orders, Process refunds, and generate reports
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro