Customize product Weight and Dimensions rows

WooCommerce can show a product’s shipping weight and dimensions on product pages. In classic product templates, those values appear as rows in the Additional information output. Use this guide to hide or relabel those rows without removing the product data used for shipping rates.

Note:

This is a Developer level doc. If you are unfamiliar working with code and resolving potential conflicts, we recommend you work with a Woo Agency Partner for larger projects, or find a WooCommerce developer on Codeable for smaller customizations. We are unable to provide support for customizations under our Support Policy.

Before you start

↑ Back to top
  • Confirm that the product still needs weight and dimensions for shipping, tax, fulfillment, or integrations before hiding the rows from customers.
  • Add PHP snippets in a child theme or custom plugin, not directly in a parent theme that receives updates.
  • Test simple and variable products after the change. Variation scripts also update weight and dimensions when a customer selects a variation.
  • This guide covers classic product template output. If your product template uses the Product Specifications block, use that block’s Weight, Dimensions, and Attributes controls in the Site Editor instead.

Hide the rows with PHP

↑ Back to top

Use the woocommerce_display_product_attributes filter when you want WooCommerce to remove the rows from the Additional information table before it renders. The product’s saved weight and dimensions remain available for shipping and other store logic.

add_filter( 'woocommerce_display_product_attributes', function( $product_attributes, $product ) {
    unset( $product_attributes['weight'], $product_attributes['dimensions'] );

    return $product_attributes;
}, 10, 2 );

Relabel the rows with PHP

↑ Back to top

Use the same filter if the store should keep the rows but make their purpose clearer to customers.

add_filter( 'woocommerce_display_product_attributes', function( $product_attributes, $product ) {
    if ( isset( $product_attributes['weight'] ) ) {
        $product_attributes['weight']['label'] = __( 'Shipping weight', 'your-textdomain' );
    }

    if ( isset( $product_attributes['dimensions'] ) ) {
        $product_attributes['dimensions']['label'] = __( 'Shipping dimensions', 'your-textdomain' );
    }

    return $product_attributes;
}, 10, 2 );

Hide the rows with CSS

↑ Back to top

Use CSS only when visual hiding is enough. This does not change the product data and does not remove the values from the page markup.

.single-product .woocommerce-product-attributes-item--weight,
.single-product .woocommerce-product-attributes-item--dimensions {
    display: none;
}

What this does not change

↑ Back to top
Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.