Rename and Reorder Product Tabs
Changes the titles and order of the Description, Additional information and Reviews tabs on product pages.
Opens WPIDE on
Code
add_filter( 'woocommerce_product_tabs', function ( $tabs ) {
// Tab => array( new title, priority ).
$settings = array(
'description' => array( 'Details', 10 ),
'reviews' => array( '', 20 ),
'additional_information' => array( 'Specifications', 30 ),
);
foreach ( $settings as $key => $setting ) {
if ( ! isset( $tabs[ $key ] ) ) {
continue;
}
if ( '' !== $setting[0] ) {
$tabs[ $key ]['title'] = $setting[0];
}
$tabs[ $key ]['priority'] = $setting[1];
}
return $tabs;
}, 98 );
Notes
Lower priority numbers come first. Leave a title empty to keep the default.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.