Normalize brand names

This article explains how to normalize brand names.

Occasionally, a product will have different brand names. For example, a pair of shoes might have the brand name Nike whereas other pairs of shoes might have the brand name Nike, Inc..

By normalizing brand names, we can reduce brand name variations to one version.

Before

Before normalizing brand names

After

After normalizing brand names

Before you begin

Before brand names get imported into your WooCommerce store, you must first make sure you have added the attribute "Brand". To do this, go here WordPress Admin Area > Products > Attributes. Add the word Brand in the "Name" field and then click the [Add Attribute] button.

1

Create a custom plugin

If you haven't done so already, create a custom plugin.

2

Add custom code

Add the following custom code

3

Edit brand names

On lines 51~54 of the above code, you will find the code that needs to be edited for your purposes.

The value on the left (ex. $map["Black Diamond"]) is the brand name that you want to use.

The value on the right (ex. array( "Black Diamond Equipment", "Black Diamond Inc" ) is an array of values you want to replace with the value on the left. Each value in the array should be surrounded with double quotes "" and be comma separated.

4

Add/Update product sets

These changes will only take effect after any new Product Sets are created or after existing Product Sets are updated.

Still need help? Contact Us Contact Us