This is the premium version documentation page. Click here to purchase SKU Generator for WooCommerce.

Introduction

SKU Generator for WooCommerce plugin adds full SKU support to WooCommerce.

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
Sequential number generation counter
Ignored if “Number Generation” is not “Sequential”.
Default: 1
Prefix
Default: None
Minimum number length
Default: 0
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
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}
Variable Products Variations field has three options:
  1. SKU exactly the same as parent product’s.
  2. SKU is different for each variation: for example, parent SKU – 0001, variations – 0002, 0003, 0004 etc.
  3. 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
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
Generate SKUs only for products with empty SKU
Default: no
Allow duplicate SKUs
Default: no
Search by SKU
Add product searching by SKU on frontend.
Default: no
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
Add SKU to customer emails
Default: no

Categories Options

Enable/Disable
Default: no
Sequential numbering on per category basis
Default: no
Category X Prefix
Default: None
Category X Suffix
Default: None
Category X Counter
Default: 1

Tags Options

Enable/Disable
Default: no
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();
    }
}