Hide an attribute row on single products in WooCommerce

Hide an attribute row on single products in WooCommerce on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'woocommerce_display_product_attributes', 'wc_exclude_attribute_from_attribute_table', 9999, 2 );
 
function wc_exclude_attribute_from_attribute_table( $product_attributes, $product ) {
   if ( isset( $product_attributes[ 'attribute_pa_color' ] ) ) unset( $product_attributes[ 'attribute_pa_color' ] );
   return $product_attributes;
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.