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.

LinkAdd or remove existing product attributes:

Markup 2020-06-22 at 15.08.25.png

LinkCreate custom attributes:

Markup 2020-06-22 at 15.11.50.png

LinkExcluding 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 4
Views: 2500

2 Replies to “Customize the attributes inside Specifications (Additional Information)”

  1. Curtis Penner

    Where should the “exclude code” be placed?

    1. Marius H[ Post Author ]

      Hey! Please try in the child theme’s functions.php file (more in this article https://support.reytheme.com/kb/how-to-add-custom-code-in-child-themes-functions-php/ ).

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!