WooCommerce PHP Beginner Requires WooCommerce

Remove, Rename or Reorder Product Tabs

Remove the Reviews or Additional information tab, rename Description, and change the order the tabs appear in.

Tested on WordPress 7.1 PHP 8.3 Updated
functions.php 16 lines
add_filter( 'woocommerce_product_tabs', function ( array $tabs ): array {
	// Remove a tab.
	unset( $tabs['additional_information'] );

	// Rename a tab.
	if ( isset( $tabs['description'] ) ) {
		$tabs['description']['title'] = 'Details';
	}

	// Reorder: lower numbers come first.
	if ( isset( $tabs['reviews'] ) ) {
		$tabs['reviews']['priority'] = 5;
	}

	return $tabs;
}, 98 );

Where to add this

Recommended A code snippets plugin Survives theme changes and is easy to switch off.
Child theme At the end of your child theme's functions.php file.
Must-use plugin As a .php file in wp-content/mu-plugins, starting with <?php.

Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.

The tabs under each product (Description, Additional information and Reviews) are WooCommerce defaults. This snippet shows how to remove one, rename one and change their order.

How it works

WooCommerce builds the tabs from the woocommerce_product_tabs filter. Each tab has a key, a title, a priority that sets the order (10, 20 and 30 by default) and a callback that prints its content.

The snippet runs at priority 98 so it applies after plugins that add their own tabs.

Things to watch

  • Removing the Reviews tab hides reviews but doesn’t stop customers leaving them. Turn reviews off under WooCommerce → Settings → Products if you don’t want them at all.
  • Tab titles with a count, like “Reviews (3)”, are built by WooCommerce. If you rename Reviews, add the count back with $product->get_review_count() if you want it.

How to test it

Open a product page. The Additional information tab should be gone, Description should be called Details, and Reviews should come first.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only