How to hide/remove products tabs content panel title

Before showing the filter hooks, first see how the product tabs content are showing in the product page. If we see the product default tabs in code, we can see the tabs array items like this:

$tabs['description'] = array(
	'title'    => __( 'Description', 'woocommerce' ),
	'priority' => 10,
	'callback' => 'woocommerce_product_description_tab',
);

$tabs['additional_information'] = array(
	'title'    => __( 'Additional information', 'woocommerce' ),
	'priority' => 20,
	'callback' => 'woocommerce_product_additional_information_tab',
);

$tabs['reviews'] = array(
	/* translators: %s: reviews count */
	'title'    => sprintf( __( 'Reviews (%d)', 'woocommerce' ), $product->get_review_count() ),
	'priority' => 30,
	'callback' => 'comments_template',
);

The above tabs array, we can see the callback functions which are loading the content of those tabs including the content panel titles. So , to remove content panel titles, we need to inspection the callback function output.

If we looks callback function output, we can see the filter hooks to filter the Description and Additional information tabs heading.

To remove Description content panel heading, use this:

add_filter( ‘woocommerce_product_description_heading’, ‘__return_null’ );

To remove Additional information content panel heading, use this:

add_filter( ‘woocommerce_product_additional_information_heading’, ‘__return_null’ );

We can not remove the Reviews content panel heading because if has no filter option to filter the content panel heading

We can remove review content panel heading using this :

add_action('admin_footer', 'reviews_content_panel_heading_remove');

function reviews_content_panel_heading_remove() {
  echo '<style>
	h2.woocommerce-Reviews-title {display:none;}
  </style>';
}

Leave a Reply

Your email address will not be published.