BEAR - WooCommerce Bulk Editor and Products Manager Professional

WooCommerce bulk create variations for many products at once

WooCommerce creates variations one product at a time: open the product, pick the attributes, press Generate variations, save, next product. To bulk create variations for a whole category, or to add a new size to hundreds of products that already have variations, BEAR has a generator in Variations Advanced Bulk Operations. Below is what it needs, how to run it, how to keep the number of variations sane, and what to do when a large run stops halfway.

Before you start: what the generator needs

  • Variable products. The generator skips every product that is not of type Variable. Convert simple products first; product type is one of the fields of the Bulk Edit tab.
  • Global attributes. Only attributes created under Products, Attributes can be used, with their terms. Attributes typed directly on a product are text and are not offered.
  • The right products selected. The operation runs on all products of the shop, the filtered products, or the ticked ones; ticked products take priority. The line Variations Advanced Bulk Operation will be applied to at the top of the tool says which. Filter by product type Variable plus a category or a tag.
  • Attributes already on the products. When an attribute is not on a product yet, the generator adds it with its terms, visible and marked Used for variations. When it is already there as a plain attribute, the generator only adds the missing terms and leaves the flag off, and the new variations get values WooCommerce does not use. Mark it Used for variations first with the Visibility tab of the same tool, as described in bulk adding attributes to products.
  • A database backup. Variations Advanced Bulk Operations are not recorded in History; nothing here can be rolled back with one click.

Bulk create variations from attributes

  1. Filter or tick the variable products, then open Variations Advanced Bulk Operations from the tools panel. The Creating tab opens first.
  2. In Select attributes choose the attributes to build variations from, for example Size and Color, and select the terms of each one that the products should get.
  3. Press Generate possible combinations. Every combination of the selected terms is listed with a checkbox; untick the ones you do not want and drag the rest into the order you prefer.
  4. Press Start BULK Adding! and keep the page open until the progress bar finishes.

Combinations a product already has are skipped, so running the generator twice never creates duplicates. That is also the way to add a new value to products that already have variations: to add XXL, select Size and Color again with XXL and all colours, generate, and only the XXL variations are created. The step-by-step page with screenshots is the variable products documentation.

Two neighbouring tabs cover the related jobs. Attaching adds a new attribute to variations that already exist, with a term per variation, for example a material for every existing size and colour; see adding attribute terms to existing variations. Swap replaces one term with another on existing variations without recreating them, so prices and stock stay.

Plan the combinations: avoid a variation explosion

The number of variations per product is the product of the term counts: 100 sizes, 3 gift boxes and 4 colours make 1,200 variations, each a separate post with its own price and stock. Before generating, ask which attributes change the price, the stock or the SKU. Only those need variations.

The other attributes can still be offered to the customer:

  • As information only. Add the attribute to the products as a plain attribute, visible but not used for variations. It appears under Additional information and in filters, but the customer does not choose it.
  • As a choice with "Any" variations. Generate the variations from the price-relevant attributes only, then add the remaining attribute to the products and mark it Used for variations in the Visibility tab. The existing variations have no value for it, which WooCommerce treats as "Any Color": the customer picks a colour, the order line records it, and one variation per size serves all colours. 300 variations instead of 1,200.

The generator itself always writes a concrete term into every variation; it does not create "Any" values. The order above, variations first and the extra attribute second, is how to get them.

What a new variation contains

  • Status: published. To create them private (disabled) instead, for example to check them before going live, use the hook:
    // Child theme functions.php or a code snippets plugin.
    // BEAR: variations created by Variations Advanced Bulk Operations start as private.
    add_filter( 'woobe_new_variation_product_status', function ( $status ) {
        return 'private';
    } );
    To publish them later in bulk, switch on variations, set the post status to Published in the Bulk Edit tab and run it; the FAQ on enabling and disabling variations shows the steps.
  • Price: usually none. A variation copies the regular and sale price only if the parent still stores one, typically a product converted from simple. Otherwise it has no price, and WooCommerce does not sell a variation without a price. Set the prices right after the run, per size if needed, as in filtering variations by attribute.
  • SKU: the parent SKU plus a hyphen and the variation ID, or sku- plus the ID when the parent has no SKU, so WooCommerce never sees a duplicate SKU.
  • Stock: not managed. Switch on Manage stock and set quantities in the Bulk Edit tab with the variations switch on.
  • Everything else comes from the parent until you set it on the variation: WooCommerce uses the parent's image, weight, dimensions, shipping class and tax class for a variation that has none of its own.

The variation pre-selected on the product page is set in the Default combination tab of the same tool: select the attributes and terms and press Apply combination for all selected products at once.

Copying a single variation is not possible: a variation is defined by its attribute values, and a copy would be a second variation with the same values, which customers could not choose between. The duplicate button on the tools panel refuses variations for that reason. Duplicate the whole product instead; the copy is created as a draft with all its variations.

Large runs: limits, timeouts and errors that are not errors

WooCommerce's own Generate variations button stops at 50 variations per click; that cap is the constant WC_MAX_LINKED_VARIATIONS. BEAR's generator does not apply it and creates every ticked combination. Its limits are the server's: the products are processed two per request, and each request creates all ticked combinations for both. A product with 1,500 combinations means thousands of database writes in one request.

  • Create in batches. Tick part of the combination list, run, tick the next part. Because existing combinations are skipped, you can also simply run the same selection again after an interruption: only what is missing is created.
  • Read the error text. Allowed memory size exhausted in the PHP error log means the request ran out of memory; raise memory_limit or make the batch smaller. A 502 or 504 means it ran out of time, often while PHP kept working.
  • An error is not proof of failure. With hundreds of combinations the progress can stop with an error although the variations were created. Open one of the products and count its variations before running again; a second run will add only the missing ones anyway.
  • Cache and optimisation plugins. Plugins that cache or rewrite admin requests have broken variation creation before, with SG Optimizer and RunCloud Hub as known cases: variations were not created or the product fell back to simple. Exclude the editor page and admin-ajax.php from them, or deactivate them for the run.

The table side of large products, rows per page and memory for thousands of variations, is covered in bulk editing thousands of products.

Undo and troubleshooting

There is no rollback for created variations. Remove wrong ones with the Deleting tab of the same tool: one exact combination per run, or Delete all products variations to start over, as in removing all variations at once. Deleting there is permanent. For a few products, tick the variation rows with the variations switch on and use the delete button of the tools panel.

  • Nothing happened. The selected products are not of type Variable, or the line at the top of the tool shows a different selection than you expected, for example one forgotten ticked product.
  • The new variations show "Any" or cannot be chosen. The attribute was on the products before the run but not marked Used for variations. Set the flag in the Visibility tab; the values are already on the variations.
  • Variation names without attribute values. WooCommerce decides whether a variation title includes its attributes, and it leaves them out when the product has three or more attributes, or two attributes and a hyphen in the name of one of them. The FAQ on variation titles has the one-line filter that changes this.
  • A term is missing from the list. Terms must exist in the global attribute before they can be selected; add them under Products, Attributes, then reopen the tool.

If a run still fails, post the number of products and combinations and the error text from the PHP log on the BEAR support forum.