Remove generated category and tag class names from woocommerce product & blog listings markup

You have to leverage the woocommerce wc_product_post_class filter. The following code should do the trick.


function my_strip_tag_class( $classes ) {

    global $post;
    $product_tags = get_the_terms( $post->ID, 'product_tag' );

    if( $product_tags ) foreach ( $product_tags as $tag ) {

        $tag_index = array_search($tag, $classes);

          if($tag_index !== false){
            unset($classes[$tag_index]);
        }

    }
    return $classes;
}
add_filter( 'wc_product_post_class', 'my_strip_tag_class' );