Customize the attributes inside Specifications (Additional Information)

You are here:
Estimated reading time: < 1 min

By default, these rows are auto-generated by WooCommerce, based on the attributes you select for the product.

Add or remove existing product attributes:

Markup 2020-06-22 at 15.08.25.png

Create custom attributes:

Markup 2020-06-22 at 15.11.50.png

Excluding through code

The code below will remove any item from the list. Simply add entries inside the `$excludes` array which should contain the attributes slugs eg: https://d.pr/i/8lcpCX .

add_filter('woocommerce_display_product_attributes', function( $product_attributes, $product ){
	// add the attribute names in this array
	$excludes = [
		'brand',
		'size',
	];
	foreach ($excludes as $exclude) {
		unset( $product_attributes[ 'attribute_pa_' . $exclude ] );
	}
	return $product_attributes;
}, 10, 2);
Was this article helpful?
Dislike 3
Views: 1654

Suggest article improvements

Please use this form to suggest improvements and report missing or outdated content. Support requests will most likely not be answered and it's best to use the Support Request Form instead. Thanks!