Create new product attribute programmatically in Woocommerce
To create a term you can use wp_insert_term() like so: wp_insert_term( ‘red’, ‘pa_colors’ ); where colors is the name of your attribute. The taxonomy name of an attribute is always prepended by pa_. Edit Attributes are merely custom taxonomies. Or you could say they are dynamic taxonomies that are manually created by the user in … Read more