BEAR - WooCommerce Bulk Editor and Products Manager Professional

WooCommerce bulk edit product tags and brands: add, replace, remove

A WooCommerce bulk edit of product tags or brands looks simple until the list gets long: add a tag to two hundred products, strip every tag from a catalogue that was tagged by an old import, give a whole range of products the right brand, or fill a brand taxonomy from a Brand attribute. Tags and brands are taxonomies, so in BEAR they work like categories, with a few differences that decide whether a run does what you expect. Below are the operations for tags, the fastest ways to remove tags in bulk, how to handle brands from WooCommerce and from the common brand plugins, and a snippet for copying an attribute into a brand taxonomy.

WooCommerce bulk edit product tags in the Bulk Edit tab

In the Bulk Edit tab every product taxonomy has its own row: Categories, Tags, Brands and the taxonomies of other plugins. Tick select it to use next to the Tags row, pick the tags in the list and choose a behaviour:

  • append adds the selected tags and keeps the existing ones. A product cannot hold the same tag twice, so running it again changes nothing.
  • replace makes the selected tags the only tags of each product.
  • remove detaches the selected tags and leaves the others.

The operation applies to the products you ticked on the current page, or, if none are ticked, to the products left by the filter in the Filters tab, or to the whole shop when there is no filter. The step-by-step examples in bulk editing categories work the same way with the Tags row. Every taxonomy run is recorded in the History tab and can be reverted.

Two details are specific to tags:

  • An empty replace does nothing to tags. If you tick the Tags row, select nothing and choose replace, the products keep their tags. For hierarchical taxonomies such as Categories and WooCommerce's Brands the same empty replace removes all their terms from the products, so never leave a taxonomy row ticked without a selection. To clear tags, use the methods in the next section.
  • The list shows existing tags only. Create a new tag under Products → Tags, or with create new term in the tags popup of the Products Editor; it appears in the Bulk Edit list straight away.

Remove all tags from WooCommerce products

Which method fits depends on how many tags there are and whether the tags themselves should survive.

Detach every tag, keep the tags in the shop

With a short tag list, tick the Tags row, select all the tags and run remove. The Bulk Edit list has no button that selects every term, so with hundreds of tags use a temporary tag instead. It takes one run and one deletion, whatever the number of tags:

  1. Create a tag such as tmp-clear under Products → Tags.
  2. Select the products, tick the Tags row, select only tmp-clear and run replace. Every product now has this one tag and no other.
  3. Delete tmp-clear under Products → Tags. Deleting a term detaches it from every product, so the products end up with no tags.

Step 2 is in History, so if the selection was wrong you can revert it and get the old tags back. Do that before step 3 if anything looks off.

Remove the tags from the shop altogether

If the tags themselves are not wanted any more, no bulk edit is needed: under Products → Tags tick the tags, choose Delete in the bulk actions and apply. WordPress detaches them from all products. This deletes the terms with their descriptions and archive pages, and BEAR's History cannot bring them back.

Remove one tag from part of the catalogue

Filter by the tag in the Filters tab, add any other condition (a category, a price range, a word in the title), then run remove with that tag in the Tags row. Products outside the filter keep it.

Replace or merge tags

To rename a tag on every product, edit its name under Products → Tags; products point to the term, so nothing else has to change. To merge t-shirt into tshirt: filter by t-shirt, append tshirt, then remove t-shirt with the same filter, or delete it under Products → Tags. One row carries one behaviour per run, so this always takes two steps.

Clearing tags in the table with binded editing

Clicking a Tags cell in the Products Editor opens a popup with a quick search, a selected only filter and a Select all terms checkbox that ticks or unticks every tag at once. With binded editing switched on and several products ticked, the set of tags you apply is written to all of them, replacing their own tags. That works as long as at least one tag stays ticked. In version 2.2.4 an empty set clears only the product whose cell you edited; the other ticked products keep their tags. To clear tags on many products, use the Bulk Edit tab as described above.

Bulk assign brands in WooCommerce

BEAR has no list of supported brand plugins because it does not need one: every taxonomy registered for products appears in it automatically, as a filter, a row in the Bulk Edit tab and a column you can switch on in the Settings tab. Most brand solutions store brands as such a taxonomy:

Brands fromTaxonomy
WooCommerce Brands, part of WooCommerce since version 9.6product_brand
YITH WooCommerce Brands Add-onyith_product_brand
Perfect Brands WooCommercepwb-brand

For any other plugin, open its brand list in the admin: the address contains taxonomy= followed by the taxonomy name. If the plugin's brands appear there, BEAR edits them like tags. To assign brands in bulk:

  1. Select the products that belong to the brand: filter by a word in the title, an SKU that begins with the brand's prefix, a category or a supplier field, or tick them.
  2. In the Bulk Edit tab tick the brands row, select the brand and choose replace if a product should have exactly one brand, or append to add it to the existing ones.
  3. Switch on the brands column to check the result, or filter by the brand.

To find the products that still have no brand, use the NOT EXISTS operator on the brands taxonomy, described in finding products without a category or brand. New brands, with their logos and descriptions, are created in the brand plugin's own screen; BEAR assigns them.

Two other setups exist. Some themes and plugins keep the brand in a product meta field: attach its key in the Meta Fields tab, as explained in finding a product meta key. Many shops use a global attribute such as Brand (pa_brand); that is an attribute row in BEAR, covered in bulk adding attributes.

Copy a Brand attribute into a brand taxonomy

A common case: the supplier feed fills the pa_brand attribute, and the brand plugin needs the same value in its own taxonomy. An attribute term and a brand term are separate objects in separate taxonomies, and the Bulk Edit tab assigns fixed terms rather than copying them, so there is no single BEAR operation for this. With a few brands, do it brand by brand: in the Filters tab select one value of the Brand attribute, then append the matching brand in the Bulk Edit tab. One filter and one run per brand.

With dozens of brands or a daily import, a one-off script is faster. It reads each product's Brand attribute, creates a brand with the same name if it does not exist yet, and assigns it:

/*
 * One-off: give every product the brand named like its Brand attribute.
 * Child theme functions.php or a code snippets plugin. As an administrator open
 * /wp-admin/?copy_attribute_to_brand=1, then =2, =3 and so on until it reports
 * 0 products. Remove the snippet afterwards.
 */
add_action( 'admin_init', function () {
	if ( empty( $_GET['copy_attribute_to_brand'] ) || ! current_user_can( 'manage_woocommerce' ) ) {
		return;
	}

	$from    = 'pa_brand';      // the attribute to read
	$to      = 'product_brand'; // the brand taxonomy: product_brand, pwb-brand, yith_product_brand...
	$replace = true;            // false keeps the brands a product already has
	$page    = max( 1, (int) $_GET['copy_attribute_to_brand'] );

	$ids = get_posts(
		array(
			'post_type'      => 'product',
			'post_status'    => 'any',
			'fields'         => 'ids',
			'posts_per_page' => 500,
			'paged'          => $page,
			'orderby'        => 'ID',
			'order'          => 'ASC',
			'tax_query'      => array(
				array(
					'taxonomy' => $from,
					'operator' => 'EXISTS',
				),
			),
		)
	);

	$updated = 0;

	foreach ( $ids as $id ) {
		$names = wp_get_post_terms( $id, $from, array( 'fields' => 'names' ) );

		if ( is_wp_error( $names ) || empty( $names ) ) {
			continue;
		}

		$brand_ids = array();

		foreach ( $names as $name ) {
			$term = term_exists( $name, $to );

			if ( ! $term ) {
				$term = wp_insert_term( $name, $to );
			}

			if ( is_array( $term ) ) {
				$brand_ids[] = (int) $term['term_id'];
			}
		}

		if ( $brand_ids ) {
			wp_set_object_terms( $id, $brand_ids, $to, ! $replace );
			++$updated;
		}
	}

	wp_die( esc_html( sprintf( 'Page %d: %d products updated.', $page, $updated ) ) );
} );
  • Set $from and $to to your attribute and brand taxonomy names first. The script works in pages of 500 products, so large catalogues do not hit the server's time limit.
  • It reads global attributes only. Values typed into a single product are custom attributes, not taxonomy terms; convert them to global attributes first.
  • The script writes directly, so BEAR's History does not record it. Take a database backup before the first page.
  • After each import, run it again; with $replace left on true, a product whose Brand attribute changed gets the new brand instead of a second one.

A hook on BEAR's attribute edits is not a substitute: in the Bulk Edit tab, attribute changes do not pass through woobe_before_update_product_field, and attributes filled by an import never touch BEAR at all.

Tags and brands in the free version

In the free version only the Categories row of the taxonomies takes part in Bulk Edit operations. The Tags and brands rows are shown in red containers without the select it to use checkbox, and binded editing of those columns is refused with a notice. The full picture is in the free version limitations.

If it does not work

  • The brands row is missing. The plugin does not register its brands as a product taxonomy; look for a meta field or an attribute as described above. For a shop manager, also check that the column is visible for the shop manager in the Settings tab.
  • Tags did not disappear. An empty replace and binded editing with no tag ticked do not clear tags on other products; use remove or the temporary tag.
  • Too many products changed. The run hit all filtered products or the whole shop because no product was ticked; open History and revert the record.

If a tag or brand run still does not give the result you expect, open a topic on the BEAR support forum with the taxonomy name, the behaviour you chose and one product ID.