Add product tags

This article explains how to automatically add tags to your WooCommerce products.


Identify fields to use for tags

First you need to identify the product fields you want to pull the tag values from. In this example, I will pull the tag values from 2 product fields: category & productgroup. You can see those fields when you view a product's details (by clicking the product's name):

Identify fields to use for tags

Create a custom plugin

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


Add custom code

Add the following code to your custom plugin file.


Modify code

The $fields array (line #20) allows you to set which fields should be used as tags. Notice that these are the exact fields found in the product details (see image above).

The $search array (line #21) allows you configure the delimiters used for each field. Some fields have multiple values separated by various characters such as ; and , and >.


Add/Update product sets

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

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us