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.
WooCommerce product pages can show Description, Additional Information, and Reviews sections. Classic themes usually display them as tabs. Block themes can display the same product data through the Product Details block or an accordion layout.
The tab label and the heading inside a tab are separate. For example, the Description tab can contain a second “Description” heading above the product’s full description. This guide covers both controls.
The PHP examples use the woocommerce_product_tabs filter. Add a snippet to your child theme’s functions.php file or use a code snippets plugin. Do not add custom code directly to a parent theme because theme updates will overwrite it.
The examples for removing, renaming, reordering, or replacing built-in tabs apply to classic themes and legacy Product Details layouts. In a block theme that uses the current Product Details blocks, edit the built-in accordion items in the Site Editor instead. The custom tab example can also add a compatible item to a Product Details accordion.
Before using a snippet, replace your_prefix with a prefix unique to your child theme or custom plugin. Replace your-textdomain with its text domain.
Remove tabs
↑ Back to topUnset a tab by its key. Remove any unset() lines for tabs that you want to keep.
if ( ! function_exists( 'your_prefix_remove_product_tabs' ) ) {
/**
* Removes product tabs.
*
* @param array $tabs Product tabs.
* @return array Product tabs.
*/
function your_prefix_remove_product_tabs( $tabs ) {
unset( $tabs['description'] );
unset( $tabs['reviews'] );
unset( $tabs['additional_information'] );
return $tabs;
}
}
add_filter( 'woocommerce_product_tabs', 'your_prefix_remove_product_tabs', 98 );
Rename tab labels
↑ Back to topChange the title value for each tab. A tab might not be available for every product, so check that it exists before changing it.
if ( ! function_exists( 'your_prefix_rename_product_tabs' ) ) {
/**
* Renames product tab labels.
*
* @param array $tabs Product tabs.
* @return array Product tabs.
*/
function your_prefix_rename_product_tabs( $tabs ) {
if ( isset( $tabs['description'] ) ) {
$tabs['description']['title'] = __( 'More information', 'your-textdomain' );
}
if ( isset( $tabs['reviews'] ) ) {
$tabs['reviews']['title'] = __( 'Ratings', 'your-textdomain' );
}
if ( isset( $tabs['additional_information'] ) ) {
$tabs['additional_information']['title'] = __( 'Product data', 'your-textdomain' );
}
return $tabs;
}
}
add_filter( 'woocommerce_product_tabs', 'your_prefix_rename_product_tabs', 98 );
Change or hide the Description heading
↑ Back to topThis heading appears inside the Description tab. Changing it does not rename or remove the tab label.
Block themes
↑ Back to topGo to Appearance > Editor > Templates and open the Single Product template. Select the Product Details block.
To hide headings inside the tabs, turn off Show tab title in content. If the template uses an accordion layout, select the Description accordion heading in List View to change its text.
Classic themes
↑ Back to topClassic themes use the woocommerce_product_description_heading filter for the heading above the full description.
Hide the heading
add_filter( 'woocommerce_product_description_heading', '__return_empty_string' );
Rename the heading
if ( ! function_exists( 'your_prefix_product_description_heading' ) ) {
/**
* Changes the product description heading.
*
* @param string $heading Product description heading.
* @return string Product description heading.
*/
function your_prefix_product_description_heading( $heading ) {
return __( 'Product details', 'your-textdomain' );
}
}
add_filter( 'woocommerce_product_description_heading', 'your_prefix_product_description_heading' );
Include the product name
if ( ! function_exists( 'your_prefix_product_name_description_heading' ) ) {
/**
* Includes the product name in the product description heading.
*
* @global WC_Product $product Current product.
*
* @param string $heading Product description heading.
* @return string Product description heading.
*/
function your_prefix_product_name_description_heading( $heading ) {
global $product;
if ( $product instanceof WC_Product ) {
return sprintf(
/* translators: %s: Product name. */
__( 'Description of %s', 'your-textdomain' ),
$product->get_name()
);
}
return $heading;
}
}
add_filter( 'woocommerce_product_description_heading', 'your_prefix_product_name_description_heading' );
Use one heading snippet at a time.
Reorder tabs
↑ Back to topWooCommerce sorts tabs by their priority. Lower values appear first.
if ( ! function_exists( 'your_prefix_reorder_product_tabs' ) ) {
/**
* Changes the order of product tabs.
*
* @param array $tabs Product tabs.
* @return array Product tabs.
*/
function your_prefix_reorder_product_tabs( $tabs ) {
if ( isset( $tabs['reviews'] ) ) {
$tabs['reviews']['priority'] = 5;
}
if ( isset( $tabs['description'] ) ) {
$tabs['description']['priority'] = 10;
}
if ( isset( $tabs['additional_information'] ) ) {
$tabs['additional_information']['priority'] = 15;
}
return $tabs;
}
}
add_filter( 'woocommerce_product_tabs', 'your_prefix_reorder_product_tabs', 98 );
Replace tab content
↑ Back to topSet a different callback to replace the content of an existing tab. This example replaces the full product description in classic themes and legacy Product Details layouts. In a blockified Product Details layout, edit the Product Description block in the Site Editor instead.
if ( ! function_exists( 'your_prefix_replace_description_tab' ) ) {
/**
* Replaces the Description tab callback.
*
* @param array $tabs Product tabs.
* @return array Product tabs.
*/
function your_prefix_replace_description_tab( $tabs ) {
if ( isset( $tabs['description'] ) ) {
$tabs['description']['callback'] = 'your_prefix_description_tab_content';
}
return $tabs;
}
}
if ( ! function_exists( 'your_prefix_description_tab_content' ) ) {
/**
* Outputs custom Description tab content.
*/
function your_prefix_description_tab_content() {
echo '<h2>' . esc_html__( 'Product details', 'your-textdomain' ) . '</h2>';
echo '<p>' . esc_html__( 'Add your custom content here.', 'your-textdomain' ) . '</p>';
}
}
add_filter( 'woocommerce_product_tabs', 'your_prefix_replace_description_tab', 98 );
Add a custom tab
↑ Back to topAdd a new entry to the tabs array and provide a callback for its content. In a current Product Details accordion, WooCommerce can inject compatible custom tabs as additional accordion items.
if ( ! function_exists( 'your_prefix_add_shipping_tab' ) ) {
/**
* Adds a custom Shipping tab.
*
* @param array $tabs Product tabs.
* @return array Product tabs.
*/
function your_prefix_add_shipping_tab( $tabs ) {
$tabs['your_prefix_shipping'] = array(
'title' => __( 'Shipping', 'your-textdomain' ),
'priority' => 50,
'callback' => 'your_prefix_shipping_tab_content',
);
return $tabs;
}
}
if ( ! function_exists( 'your_prefix_shipping_tab_content' ) ) {
/**
* Outputs custom Shipping tab content.
*/
function your_prefix_shipping_tab_content() {
echo '<h2>' . esc_html__( 'Shipping', 'your-textdomain' ) . '</h2>';
echo '<p>' . esc_html__( 'Add your shipping information here.', 'your-textdomain' ) . '</p>';
}
}
add_filter( 'woocommerce_product_tabs', 'your_prefix_add_shipping_tab' );
The Additional Information tab
↑ Back to topWooCommerce adds the Additional Information tab when a product has attributes, weight, or dimensions to display. Attributes must have Visible on the product page enabled.
If the tab is missing for a product, check its data before troubleshooting a snippet. The examples in this guide use isset() before changing optional tabs.