Customize the attributes inside Specifications (Additional Information)

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:

Create custom attributes:

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: screenshot .

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);
Show comments and replies (closed)Hide comments and replies

Left here in 2022, when comments were open. The answers were written then and may describe a version of Rey that has changed since.

  1. Curtis

    Where should the "exclude code" be placed?

  2. MariusRey

    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/ ).

Was this article helpful?