Title: Product SKU Generator for WooCommerce
Author: SkyVerge
Published: <strong>April 13, 2014</strong>
Last modified: April 23, 2026

---

Search plugins

![](https://ps.w.org/woocommerce-product-sku-generator/assets/banner-772x250.png?
rev=3513838)

![](https://ps.w.org/woocommerce-product-sku-generator/assets/icon-256x256.png?rev
=3513838)

# Product SKU Generator for WooCommerce

 By [SkyVerge](https://profiles.wordpress.org/skyverge/)

[Download](https://downloads.wordpress.org/plugin/woocommerce-product-sku-generator.2.5.1.zip)

 * [Details](https://en-au.wordpress.org/plugins/woocommerce-product-sku-generator/#description)
 * [Reviews](https://en-au.wordpress.org/plugins/woocommerce-product-sku-generator/#reviews)
 *  [Installation](https://en-au.wordpress.org/plugins/woocommerce-product-sku-generator/#installation)
 * [Development](https://en-au.wordpress.org/plugins/woocommerce-product-sku-generator/#developers)

 [Support](https://wordpress.org/support/plugin/woocommerce-product-sku-generator/)

## Description

> **Requires: WooCommerce 3.9.4** or newer

Automatically generate a SKU for parent / simple products, variations, or both when
the product is published or updated.

> **IMPORTANT:** The SKU field will be disabled for SKUs being generated by the 
> plugin. Your own previously created SKUs **will be overridden** if you update 
> a product while generating SKUs, and they will change if you change your product
> slug (while using this to generate them). Be sure you want to complete automate
> SKUs if you leave this enabled all of the time.

You can also selectively enable and disable the plugin if you don’t want to override
existing SKUs when saving products. You can [view product documentation](http://www.skyverge.com/product/woocommerce-product-sku-generator/)
for help.

#### Automated SKUs

SKUs for simple, external, or parent products can be generated from the product’s
slug (hyphenated name) or ID. For example, a product with the slug `wp-tee-shirt`
can have a SKU of `wp-tee-shirt` or `192` (whatever the product’s ID is). This SKU
will be generated any time the product is published or updated.

If the product is a variable product, this plugin can also generate SKUs for the
product variations if desired (these typically inherit the parent SKU). Variation
SKUs can either append attribute slugs or variation IDs for each variation to the
parent SKU.

[Here are some samples](https://cldup.com/8UdEpry7Q4.png) of different SKU formats
that can be created with this plugin.

You can also manually set simple / parent SKUs, or manually set the variation SKUs,
if you don’t want the plugin to generate them for you.

#### Features

This plugin provides options to:

 * automatically generate simple / parent product SKUs when the product is published
   or updated
 * generate simple / parent product SKUs using the product slug or ID
 * automatically generate SKUs for product variations when the product is published
   or updated
 * generate variation SKUs using the attribute slugs or variation ID
 * use the bulk product update action to easily force SKU generation for more than
   one product — handy to bulk-generate SKUs for products created before installing
   this plugin

#### SKUs for all product types

The Product SKU Generator for WooCommerce lets you determine which SKUs should be
generated automatically, and whether these SKUs should use product slugs or IDs.
If a SKU is generated, the input for that SKU will be disabled since you cannot 
adjust it.

If you choose not to generate a SKU, then you can enter your own SKU. For example,
if you only generate variation SKUs, then you can enter a parent product SKU. This
will be used as the base for your generated variation SKUs, and slugs or IDs will
be appended to it.

If you only create parent / simple SKUs, you will be able to manually create your
own variation SKUs, as these will not be overridden by saving or updating a product.

#### Bulk Updating

You can bulk add SKUs to products that you’ve created prior to installing this plugin.
If you select the products you want to update, then bulk edit them, all you have
to do is hit “Update”. When the products are saved, SKUs will be generated for all
products.

This action will also automatically generate the SKUs for product variations if 
you have them enabled.

#### More Details

 * See the [product page](http://www.skyverge.com/product/woocommerce-product-sku-generator/)
   for full details and documentation
 * View more of SkyVerge’s [free WooCommerce extensions](https://profiles.wordpress.org/skyverge/)
 * View all [WooCommerce extensions](http://www.skyverge.com/shop/) from SkyVerge

#### Translations

**The plugin text domain is**: `woocommerce-product-sku-generator`

#### Attribute Names

By default, if you have an attribute name with a space (such as “Burnt Marshmallow”
for color), the SKU will use this exact formatting. A SKU for this variation would
look like: `parentSKU-Burnt Marshmallow`

If you enable the setting to replace spaces, this will instead look like: `parentSKU-
Burnt_Marshmallow` or `parentSKU-Burnt-Marshmallow` — depending on which setting
you’ve chose. This is helpful if your external fulfillment service does not allow
spaces in SKUs.

#### Attribute Sorting

In very rare cases, you may find that variation SKUs do not sort attributes in the
same order. For example, one variation may be `tee-shirt-large-black`, and another
could be `tee-shirt-black-medium`.

If this occurs, you can force attributes to sort themselves consistently before 
generating the SKU, which will resolve this problem. You could also consider this
for new installations.

**Be sure you want to enable this** if you have existing SKUs, as variation SKUs
that were generated previously _could_ be overridden while updating a product – 
they’ll be re-generated with the forced attribute order.

To force attribute sorting, add this code snippet where you add your site modifications,
such as a custom plugin or theme’s functions.php:

    ```
    add_filter( 'wc_sku_generator_force_attribute_sorting', '__return_true' );
    ```

## Screenshots

[⌊Plugin Settings⌉⌊Plugin Settings⌉[

Plugin Settings

[⌊Automatic SKU generation upon publish / update⌉⌊Automatic SKU generation upon 
publish / update⌉[

Automatic SKU generation upon publish / update

[⌊Automatic variation SKUs based on attributes (if enabled)⌉⌊Automatic variation
SKUs based on attributes (if enabled)⌉[

Automatic variation SKUs based on attributes (if enabled)

[⌊Variation SKU generated when you set the parent SKU (if you only generate variation
SKUs)⌉⌊Variation SKU generated when you set the parent SKU (if you only generate
variation SKUs)⌉[

Variation SKU generated when you set the parent SKU (if you only generate variation
SKUs)

[⌊Some sample generated SKU formats⌉⌊Some sample generated SKU formats⌉[

Some sample generated SKU formats

## Installation

> **NOTE that** any time a product is updated, its SKU will be generated, so this
> may override old SKUs if you update products. This plugin is meant for complete
> SKU automation, or you can selectively enable / disable it as needed.

 1. Be sure you’re running WooCommerce 3.9+ in your shop.
 2. You can:
 3.  * upload the entire `woocommerce-product-sku-generator` folder to the `/wp-content/
       plugins/` directory,
     * upload the .zip file with the plugin under **Plugins > Add New > Upload**, or
     * Search for “Product SKU Generator for WooCommerce” under Plugins > Add New
 4. Activate the plugin through the **Plugins** menu in WordPress
 5. Click the “Configure” plugin link or go to **WooCommerce > Settings > Products**
    and scroll down to the “Product SKUs”. Select which SKUs you’d like to generate
    and what should be used to generate them.
 6. If you generate variation SKUs with slugs, determine if spaces in attribute names
    should be replaced with underscores instead.
 7. View [documentation on the product page](http://www.skyverge.com/product/woocommerce-product-sku-generator/)
    for more help if needed.

## FAQ

### What happens to my old SKUs?

This plugin generates SKUs any time products are created or updated. Your old SKUs
will be overridden if you use it – **only** leave the plugin enabled if you don’t
want to manage SKUs yourself.

You can also selectively disable and re-enable the plugin if you don’t want to override
SKUs when saving products.

### How do I add SKUs to old products?

Select the products you’d like to generate SKUs for under **Products**. Go to the
bulk actions in the top left and click “Edit”, then apply. All you need to do is
hit “Update” to save these products, and SKUs will automatically be added.

### Why does whatever I enter for the variation SKU get overridden?

Variation SKUs can be set manually if you’re _not_ generating them. **They will 
be overridden** if your settings are set auto-generate them, even if you try to 
change them manually. Please check your settings here.

If you’d like to change a SKU for a product, disable the plugin, change the SKU,
and update the product. You can re-enable the plugin as needed.

### I’m using IDs for SKUs. Will they be sequential?

Roughly, yes. Actually, no. The SKUs will increase as you add more products / variations,
but these use the post ID from WordPress (similar to your orders). Each SKU will
be higher than the last, but they won’t be exactly in order, as other posts (like
blog posts, orders or products), also use the same ID counter. Your SKUs will increase,
but skip numbers.

### Can I use something other than the product slug to generate the SKUs?

Yep! Version 2.0 added the ability to use product slugs or IDs.

For more advanced uses, you can use the `wc_sku_generator_sku` filter, which passes
the parent SKU as the value and the product as a variable, to change what’s used
as the parent SKU. You can change the variation SKU using the `wc_sku_generator_variation_sku`
filter.

You **must** use a unique value for SKUs (WooCommerce checks this). For example,
you could generate a unique string or number in a custom snippet to use for the 
SKU with the help of a developer.

### Sometimes attributes for my variation SKUs aren’t in the same order. Can I fix this?

We’ve seen this happen in only one situation, so we have a filter + code snippet
rather than a setting for this. Please see the instructions in [Other Notes](https://wordpress.org/plugins/woocommerce-product-sku-generator/other_notes/)
to force the attribute order.

### This is handy! Can I contribute?

Yes you can! Join in on our [GitHub repository](https://github.com/skyverge/woocommerce-product-sku-generator/)
and submit a pull request 🙂

## Reviews

![](https://secure.gravatar.com/avatar/c83f9aac1ec8ab33721c681ecaaf2ba97b238f93f92e25bb73f9236494e80929?
s=60&d=retro&r=g)

### 󠀁[Really helpfull!](https://wordpress.org/support/topic/really-helpfull-21/)󠁿

 [goodmansdyr](https://profiles.wordpress.org/goodmansdyr/) March 4, 2025 3 replies

This awesome plugin is f***ing AMAZING 😁. It saved my store!

![](https://secure.gravatar.com/avatar/a8c9bd441fef0292f95852f2c34a36fbc91545871decb9c4e67726be16dbb4ee?
s=60&d=retro&r=g)

### 󠀁[Perfect plugin and the support is awesome. Fast, helpfull](https://wordpress.org/support/topic/perfect-plugin-and-the-support-is-awesome-fast-helpfull/)󠁿

 [freecee](https://profiles.wordpress.org/freecee/) June 30, 2023 1 reply

Perfect plugin, awesome support. I love this plugin

![](https://secure.gravatar.com/avatar/834bb392c19cce27b2cf2b830f04ad3b10c7bd04b3b65d8fe078161d8b84f27d?
s=60&d=retro&r=g)

### 󠀁[Does what it says](https://wordpress.org/support/topic/does-what-it-says-930/)󠁿

 [artimondigital](https://profiles.wordpress.org/artimondigital/) August 7, 2020
1 reply

I don't have advanced needs for SKUs, just to be able to automatically generate 
SKUs for all products and variants in bulk. And this plugin does it very well (at
least for a couple hundreds of products)

![](https://secure.gravatar.com/avatar/64b807895b703b7697817a5b621c071688af6b9fd0e9e8f7aa55c294b66d6b27?
s=60&d=retro&r=g)

### 󠀁[Great plugin, to generate SKU!](https://wordpress.org/support/topic/great-plugin-to-generate-sku/)󠁿

 [johnyyw](https://profiles.wordpress.org/johnyyw/) November 23, 2019 1 reply

Works perfect! Saved me lot of time! + fixed last errors on search console, regardings
to SKU! Keep up the good work! Thank you!

![](https://secure.gravatar.com/avatar/288fce37271ee7548a8d8f30371b313487a34884e4decf1fffcbb05afaeba4ea?
s=60&d=retro&r=g)

### 󠀁[Great plugin](https://wordpress.org/support/topic/great-plugin-23648/)󠁿

 [gevcen](https://profiles.wordpress.org/gevcen/) November 11, 2019 1 reply

Often updated to new version of WP & WooCommerce

![](https://secure.gravatar.com/avatar/5d45598145c373f52c307f638a0719dc86f2c842c3b656d54975d9717c22166d?
s=60&d=retro&r=g)

### 󠀁[Perfect!](https://wordpress.org/support/topic/perfect-6032/)󠁿

 [Trongbach](https://profiles.wordpress.org/trongbach/) April 26, 2019 1 reply

It saved me days of manual work!

 [ Read all 20 reviews ](https://wordpress.org/support/plugin/woocommerce-product-sku-generator/reviews/)

## Contributors & Developers

“Product SKU Generator for WooCommerce” is open source software. The following people
have contributed to this plugin.

Contributors

 *   [ SkyVerge ](https://profiles.wordpress.org/skyverge/)
 *   [ Beka Rice ](https://profiles.wordpress.org/bekarice/)

“Product SKU Generator for WooCommerce” has been translated into 5 locales. Thank
you to [the translators](https://translate.wordpress.org/projects/wp-plugins/woocommerce-product-sku-generator/contributors)
for their contributions.

[Translate “Product SKU Generator for WooCommerce” into your language.](https://translate.wordpress.org/projects/wp-plugins/woocommerce-product-sku-generator)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/woocommerce-product-sku-generator/),
check out the [SVN repository](https://plugins.svn.wordpress.org/woocommerce-product-sku-generator/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/woocommerce-product-sku-generator/)
by [RSS](https://plugins.trac.wordpress.org/log/woocommerce-product-sku-generator/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2026.04.23 – version 2.5.1

 * Fix – Address `wc_enqueue_js()` deprecation warnings
 * Fix – Address “translation loaded too early” warnings

#### 2023.07.28 – version 2.5.0

 * Misc – Add compatibility for WooCommerce High Performance Order Storage (HPOS)
 * Misc – Require PHP 7.4+ and WordPress 5.6+
 * Dev – Add `wc_sku_generator_variation_attributes` filter to allow modification
   of variation attributes used for SKU generation

#### 2022.07.31 – version 2.4.8

 * Fix – Sanitize input

#### 2022.07.31 – version 2.4.7

 * Misc – Rename to Product SKU Generator for WooCommerce

#### 2022.03.01 – version 2.4.6

 * Fix – Avoid uncaught error when saving variable products in certain environments
 * Misc – Replace calls to deprecated `is_ajax()` with `wp_doing_ajax()`
 * Misc – Require WooCommerce 3.9.4 or newer

#### 2020.05.04 – version 2.4.5

 * Misc – Add support for WooCommerce 4.1

#### 2020.03.10 – version 2.4.4

 * Misc – Add support for WooCommerce 4.0

#### 2020.02.12 – version 2.4.3

 * Fix – Prevent PHP 7.4 deprecated notice while generating variation SKUs

#### 2020.02.05 – version 2.4.2

 * Misc – Add support for WooCommerce 3.9

#### 2019.11.11 – version 2.4.1

 * Misc – Add support for WooCommerce 3.8

#### 2019.08.15 – version 2.4.0

 * Misc – Add support for WooCommerce 3.7
 * Misc – Remove support for WooCommerce 2.6

#### 2019.06.12 – version 2.3.5

 * Tweak – Ensure generated SKUs are unique before saving
 * Fix – Prevent errors when saving invalid SKUs

#### 2018.07.17 – version 2.3.4

 * Misc – Remove support for WooCommerce 2.5

#### 2017.09.10 – version 2.3.3

 * Tweak – POST variable SKUs when disabled to ensure plugins checking for this 
   specifically find it

#### 2017.08.22 – version 2.3.2

 * Tweak: Disable variation SKU inputs when being generated
 * Fix: PHP warning when WooCommerce is outdated

#### 2017.03.27 – version 2.3.1

 * Fix: Skip trying to generate a SKU for removed variations, which will cause errors

#### 2017.03.23 – version 2.3.0

 * Feature: adds setting to remove spaces from attribute names
 * Fix: SKUs are now set for out of stock variations
 * Misc: bump required WP version to 4.1
 * Misc: added support for WooCommerce 3.0
 * Misc: removed support for WooCommerce 2.3.x and 2.4.x

#### 2016.05.31 – version 2.2.0

 * Feature: attribute names can now replace spaces with hyphens in addition to underscores
 * Misc: added support for WooCommerce 2.6
 * Misc: removed support for WooCommerce 2.2

#### 2016.01.18 – version 2.1.0

 * Feature: adds setting to replace spaces in attribute names with underscores if
   variation SKUs use them
 * Misc: updated text domain to `woocommerce-product-sku-generator` — **please update
   translations**!
 * Misc: added WooCommerce 2.5 support

#### 2015.08.20 – version 2.0.1

 * Fix: SKUs generated from UTF-8 characters are no longer encoded

#### 2015.08.19 – version 2.0.0

 * Feature: You can now generate SKUs using slugs **or** IDs for products / variations
 * Misc: confirms WooCommerce 2.4 compatibility
 * Misc: **requires WooCommerce 2.2 or newer**
 * Misc: refactored for better performance and to add install / upgrade routine
 * Misc: introduce `wc_sku_generator_variation_sku` and `wc_sku_generator_variation_sku_format`
   filters to adjust generated SKU for variations
 * Misc: introduce `wc_sku_generator_force_sorting` filter to force attribute sorting
   in SKUs, props [@humancopy](https://github.com/humancopy)!

#### 2015.03.03 – version 1.2.2

 * Misc: added `wc_sku_generator_sku` filter to change generated SKU base for simple/
   parent products

#### 2015.02.06 – version 1.2.1

 * Fix: bug with loading translations

#### 2015.02.04 – version 1.2.0

 * Misc: WooCommerce 2.3 compatibility
 * Misc: Settings moved to Product Data (WC 2.2)
 * Misc: Text domain updated to `wc-product-sku-generator`

#### 2014.08.29 – version 1.1.1

 * Fix: issue with default option being selected

#### 2014.08.12 – version 1.1

 * New: Option to generate only variation SKUs automatically

#### 2014.07.23 – version 1.0.2

 * Fix: Changed SKU disable method to remove javascript

#### 2014.06.13 – version 1.0.1

 * Re-versioned + incremented for bug fix
 * Fix: javascript issue during WooCommerce update

#### 2014.04.15 – version 0.1

 * Initial Release

## Meta

 *  Version **2.5.1**
 *  Last updated **6 months ago**
 *  Active installations **8,000+**
 *  WordPress Version ** 5.6 or higher **
 *  Tested up to **6.9.10**
 *  PHP Version ** 7.4 or higher **
 *  Languages
 * [Danish](https://da.wordpress.org/plugins/woocommerce-product-sku-generator/),
   [Dutch](https://nl.wordpress.org/plugins/woocommerce-product-sku-generator/),
   [English (US)](https://wordpress.org/plugins/woocommerce-product-sku-generator/),
   [Greek](https://el.wordpress.org/plugins/woocommerce-product-sku-generator/),
   [Russian](https://ru.wordpress.org/plugins/woocommerce-product-sku-generator/),
   and [Ukrainian](https://uk.wordpress.org/plugins/woocommerce-product-sku-generator/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/woocommerce-product-sku-generator)
 * Tags
 * [product sku](https://en-au.wordpress.org/plugins/tags/product-sku/)[sku](https://en-au.wordpress.org/plugins/tags/sku/)
   [sku generator](https://en-au.wordpress.org/plugins/tags/sku-generator/)[woocommerce](https://en-au.wordpress.org/plugins/tags/woocommerce/)
 *  [Advanced View](https://en-au.wordpress.org/plugins/woocommerce-product-sku-generator/advanced/)

## Ratings

 4.9 out of 5 stars.

 *  [  19 5-star reviews     ](https://wordpress.org/support/plugin/woocommerce-product-sku-generator/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/woocommerce-product-sku-generator/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/woocommerce-product-sku-generator/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/woocommerce-product-sku-generator/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/woocommerce-product-sku-generator/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/woocommerce-product-sku-generator/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/woocommerce-product-sku-generator/reviews/)

## Contributors

 *   [ SkyVerge ](https://profiles.wordpress.org/skyverge/)
 *   [ Beka Rice ](https://profiles.wordpress.org/bekarice/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/woocommerce-product-sku-generator/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal@skyverge.com&item_name=Donation+for+WooCommerce+SKU+Generator)