SKU Generator for WooCommerce plugin adds full SKU support to WooCommerce:
- Set SKU by custom format (prefix, suffix, number length, category, tag) automatically for new products.
- Regenerate SKUs for all existing products – tested in WooCommerce shop with large number of products.
- Optionally regenerate only for products with no SKU.
- Add product searching by SKU on frontend.
- Add SKU to customer emails.
- Allow duplicate SKUs.
SKU Format Options
This section lets you set format for SKUs.
- Number generation
- Possible values: from product ID, sequential or pseudorandom.
- Default:
From product ID
- Default:
- Sequential number generation counter
- Ignored if “Number Generation” is not “Sequential”.
- Default:
1
- Default:
- Prefix
- Default: None
- Minimum number length
- Default:
0
- Default:
- Suffix
- Default: None
- Variable products variations
- Possible values: SKU same as parent’s product, generate different SKU for each variation or SKU same as parent’s product + variation letter suffix.
- Default:
SKU same as parent's product
- Default:
- Template
- Replaced values:
{category_prefix}
,{category_suffix}
,{category_slug}
,{category_name}
,{tag_prefix}
,{tag_suffix}
,{tag_slug}
,{tag_name}
,{prefix}
,{suffix}
,{variation_suffix}
,{sku_number}
. Please note that in order to use any of{category_...}
or{tag_...}
replaced values, corresponding section must be enabled.- Default:
{category_prefix}{tag_prefix}{prefix}{sku_number}{suffix}{tag_suffix}{category_suffix}{variation_suffix}
- Default:
Variable Products Variations field has three options:
- SKU exactly the same as parent product’s.
- SKU is different for each variation: for example, parent SKU – 0001, variations – 0002, 0003, 0004 etc.
- SKU same as parent product’s + variation letter suffix: for example parent SKU – 0001, variations – 0001a, 0001b, 0001c etc.
More Options
- Automatically generate SKU for new products
- If enabled – all new products will automatically get SKU according to set format values. To change SKUs of existing products, use Regenerator tool.
- Default:
yes
- Default:
- Delay SKU generation till product is published
- Check this if you are using category/tag prefix/suffix for products SKU or individual SKUs for variations.
- Default:
yes
- Default:
- Generate SKUs only for products with empty SKU
- Default:
no
- Default:
- Allow duplicate SKUs
- Default:
no
- Default:
- Search by SKU
- Add product searching by SKU on frontend.
- Default:
no
- Default:
- Search by SKU: Algorithm
- Change this if you are experiencing issues with search by SKU on frontend. Possible values: posts_search; pre_get_posts.
- Default:
posts_search
- Default:
- Add SKU to customer emails
- Default:
no
- Default:
Categories Options
- Enable/Disable
- Default:
no
- Default:
- Sequential numbering on per category basis
- Default:
no
- Default:
- Category X Prefix
- Default: None
- Category X Suffix
- Default: None
- Category X Counter
- Default:
1
- Default:
Tags Options
- Enable/Disable
- Default:
no
- Default:
- Tag X Prefix
- Default: None
- Tag X Suffix
- Default: None
SKU Regenerator Tool
Tips & Tricks
To style SKU on frontend, try adding some custom CSS (e.g. to “Appearance > Customize > Additional CSS”):
div.product_meta span { display: block !important; } div.product_meta span.sku_wrapper { color: green !important; } div.product_meta span.sku { color: red !important; }
For developers – to get SKU by product ID in PHP:
if ( ! function_exists( 'get_product_sku_by_id' ) ) { /** * Gets product SKU by product ID in WooCommerce. */ function get_product_sku_by_id( $product_id ) { $product = wc_get_product( $product_id ); return $product->get_sku(); } }
Free vs Pro
Free Version | Pro Version | |
---|---|---|
Number generation: From product ID | ||
Number generation: Sequential | ||
Number generation: Pseudorandom | ||
SKU prefix | ||
Minimum number length | ||
SKU suffix | ||
Variable products variations: SKU same as parent’s product | ||
Variable products variations: Generate different SKU for each variation | ||
Variable products variations: SKU same as parent’s product + variation letter suffix | ||
SKU template | ||
Automatically generate SKU for new products | ||
Delay SKU generation till product is published | ||
Generate SKUs only for products with empty SKU | ||
Allow duplicate SKUs | ||
Search by SKU on frontend | ||
Add SKU to customer emails | ||
Categories: Sequential numbering on per category basis | ||
Categories: SKU prefix per category | ||
Categories: SKU suffix per category | ||
Tags: SKU prefix per tag | ||
Tags: SKU suffix per tag | ||
“SKU Regenerator” tool |
Bennett –
Great plugin! Best of all SKU plugins I have tried and support is very responsive.