php - Hide product attributes from additional information tab in WooCommerce


How to hide certain custom product attributes on single product pages additional informations tab?

Note: I don´t want to hide everything, just specific attributes.

For e.g i would like to hide"pa_size" to name one it it.

Only found this one, but its for a products weight.

add_filter( 'woocommerce_product_get_weight' , '__return_false' );



Using thefunctions.php can cause problems with shipping, see here:

Simply copy thewp-content/plugins/woocommerce/templates/single-product/product-attributes.php towp-content/themes/YOUR_CHILD_THEME/woocommerce/single-product/product-attributes.php and add anif to check for the attribute. (As LoicTheAztec mentioned in #3)

This is from WooCommerce 4.4.1:

 * Product attributes
 * Used by list_attributes() in the products class.
 * This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-attributes.php.
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 * @see
 * @package WooCommerce/Templates
 * @version 3.6.0

defined( 'ABSPATH' ) || exit;

if ( ! $product_attributes ) {
<table class="woocommerce-product-attributes shop_attributes">
    <?php foreach ( $product_attributes as $product_attribute_key => $product_attribute ) : ?>
        <?php // Hide weight attribute in frontend ?>
        <?php if ( esc_attr( $product_attribute_key ) !== 'weight' ): ?>
            <tr class="woocommerce-product-attributes-item woocommerce-product-attributes-item--<?php echo esc_attr( $product_attribute_key ); ?>">
                <th class="woocommerce-product-attributes-item__label"><?php echo wp_kses_post( $product_attribute['label'] ); ?></th>
                <td class="woocommerce-product-attributes-item__value"><?php echo wp_kses_post( $product_attribute['value'] ); ?></td>
        <?php endif; ?>
    <?php endforeach; ?>



I was looking for an answer for the same/similar issue, wanting to remove the additional information tab. I came across this post using the woocommerce_product_tabs filter

I added it to functions.php and the additional information tab is no longer added to the page.

People are also looking for solutions to the problem: php - Many belongsTo on the same table Laravel


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.