How to Change the "Dimensions" Title in the WooCommerce Additional Information Tab
If you're running an e-commerce store using WooCommerce, you've likely noticed the "Dimensions" title in the Additional Information tab on your single product pages. This is a default WooCommerce feature that displays the product's dimensions, but sometimes you may want to change the title to something more descriptive, such as "Box Dimensions".
Fortunately, WooCommerce makes it easy to override the default template files, allowing you to customize this and other elements of your product pages. In this article, we'll walk you through the step-by-step process of changing the "Dimensions" title to "Box Dimensions" in the Additional Information tab.
Step 1: Create the WooCommerce Folder in Your Child Theme (or Active Theme)
Before you can start making changes, you'll need to create a "woocommerce" folder in your active child theme (or active theme) directory. This is where you'll be placing the modified template files.
If you're using a child theme, the directory structure should look like this:
your-child-theme/
├── style.css
├── functions.php
└── woocommerce/
└── single-product/
└── product-attributes.php
If you're not using a child theme, the directory structure should look like this:
your-active-theme/
├── style.css
├── functions.php
└── woocommerce/
└── single-product/
└── product-attributes.php
Step 2: Copy the product-attributes.php
Template File
Next, you'll need to copy the product-attributes.php
template file from the WooCommerce plugin directory to your woocommerce/single-product/
folder. The original file is located at:
wp-content/plugins/woocommerce/templates/single-product/product-attributes.php
Copy this file and paste it into your woocommerce/single-product/
folder.
Step 3: Modify the "Dimensions" Title
Open the product-attributes.php
file in your text editor, and locate the following line:
<th><?php _e( 'Dimensions', 'woocommerce' ) ?></th>
Replace it with:
<th><?php _e( 'Box Dimensions', 'woocommerce' ) ?></th>
This will change the "Dimensions" title to "Box Dimensions" in the Additional Information tab.
Step 4: Customize the Displayed Units (Optional)
If you'd also like to customize the displayed units for the product dimensions, you can use the following hooked function in your functions.php
file:
add_filter( 'woocommerce_format_dimensions', 'custom_format_dimensions', 20, 2 );
function custom_format_dimensions( $dimension_string, $dimensions ) {
$dimension_string = implode( ' x ', array_filter( array_map( 'wc_format_localized_decimal', $dimensions ) ) );
if ( ! empty( $dimension_string ) )
$dimension_string .= ' ' . __("KG", "woocommerce");
else
$dimension_string = __( 'N/A', 'woocommerce' );
return $dimension_string;
}
This function will display the dimensions in the format "Width x Height x Length KG". If the dimensions are not available, it will display "N/A".
You can customize the displayed units by modifying the __("KG", "woocommerce")
part of the code. For example, you could change it to __("cm", "woocommerce")
to display the dimensions in centimeters.
Alternatively, you can change the displayed units in the WooCommerce settings by navigating to WooCommerce > Settings > Products > General and updating the "Unit" fields.
Testing and Verifying the Changes
After making the changes, clear your browser cache and refresh the single product page on your website. You should see the "Dimensions" title changed to "Box Dimensions" in the Additional Information tab.
If you've also customized the displayed units, you should see the new format (e.g., "Width x Height x Length KG") or the updated unit (e.g., "Width x Height x Length cm").
Get a Free AI Website Audit
Automatically identify UX and content issues affecting your conversion rates with Flowpoint's comprehensive AI-driven website audit.
Conclusion
In this article, you've learned how to easily change the "Dimensions" title in the WooCommerce Additional Information tab by overriding the default template file. You've also seen how to customize the displayed units for the product dimensions.
These types of customizations can help you create a more user-friendly and visually appealing product page, which can ultimately lead to better customer experience and increased conversions. If you have any further questions or need assistance, feel free to reach out to the Flowpoint.ai team, which specializes in providing data-driven recommendations to improve your website's performance.