Support » Plugin: WooCommerce Product SKU Generator » Can’t leave main SKU blank – doesn’t generate variable SKUs

  • Resolved rosalynteltronix


    I was looking at an old topic and found an answer from Steve, (quoted below). this suggestion does not work for me. Setting to never causes the variable SKU box to consistently say Save product to generate SKU, no matter how many times I save, the SKU is not generated. It’s like it HAS to have something in the main product SKU box in order to generate the variables. Like the original author of this question, I don’t want the main product SKU at all, just the variables. Can you help, please?

    “Hey @kbdiverservices ,

    Thanks for writing to us about our Product SKU Generator plugin! Iā€™d be happy to help out here. šŸ™‚

    The format for the variable SKU can be changed in WooCommerce > Settings Products > Product SKUs. Here you can select to use the Product ID, the Product Slug, or Never. From what it sounds like, the Never option should generate the SKU as you have described.

    Can you please try the Never settings here and let me know if this generates the SKU correctly for you?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Steve


    Hey @rosalynteltronix,

    Thanks for writing to us about our Product SKU Generator plugin! Happy to help šŸ™‚

    The reply that you referenced here was to assist with the merchant’s need to create unique SKU’s for each variation, which could have been potentially accomplished with the Never setting in place. It turned out that to meet their needs, they had to get some customizations to the plugin added.

    Can you please let me know how you are looking to format your SKU’s? I can then see if we might be able to find something that would work for your scenario.



    Thread Starter rosalynteltronix


    Hi Steve,

    I have managed to get around my issue by adding snippet to work in conjunction with your plugin, it allows duplicate SKUs. As your plugin doesn’t allow for a blank main product SKU in order to generate variations.

    This way, I use ‘:’ in all parent product SKUs. Your plugin then recognises it as a SKU, and generates exactly as I hoped. so my SKUs look like this until I select from the dropdown…

    Example PN :

    Then this…


    In an ideal world, I would have liked to have left the SKU blank (without the ‘:’) but as I said, your plugin won’t allow for this.

    I also used some snippets suggested in another thread to remove dashes.

    // Removes the separator between variations in a generated SKU
    add_filter( ‘wc_sku_generator_attribute_separator’, ‘__return_empty_string’ );

    $product_sku = apply_filters( ‘wc_sku_generator_sku’, $product_sku, $product );

    if ( !empty( $product_sku ) ) {

    // Removes the unique SKU function allowing for duplicate SKUs

    add_filter( ‘wc_product_has_unique_sku’, ‘__return_false’ );

    * Adjust the format of generated SKUs
    * @param string $sku the original complete SKU
    * @param string $product_sku the parent product SKU
    * @param string $variation_sku the SKU to represent a variation, if set
    * @return string the updated complete SKU
    function sv_wc_alter_generated_sku( $sku, $product_sku, $variation_sku ) {
    return $product_sku . $variation_sku;
    add_filter( ‘wc_sku_generator_variation_sku_format’, ‘sv_wc_alter_generated_sku’, 10, 3 );`

    Plugin Support Steve


    Hey @rosalynteltronix

    Wonderful! Glad that you were able to put together a solution for this!

    Thank you so much for sharing your snippet here, this will be quite helpful for other merchants that are looking to add the SKU’s for variable products. Much appreciated šŸ™‚



Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.