Create a Custom Product Tab
In this tutorial I will show you how to add a new tab on WooCommerce product page. We are going to do it without plugins because it is really easy. Well, it depends on what you are going to display inside your tab, but in general it is simple.
You may also be interested in how to remove default tabs or rename them or change their order.
Now let’s take a look at the screenshot what we are going to achieve in this tutorial.

And the code:
add_filter( 'woocommerce_product_tabs', 'misha_custom_tab' );
function misha_custom_tab( $tabs ) {
$tabs[ 'misha_custom_tab' ] = array(
'title' => 'About Misha',
'callback' => 'misha_custom_tab_content', // the function name, which is on line 14
'priority' => 50,
);
return $tabs;
}
function misha_custom_tab_content( $slug, $tab ) {
echo '<h2>' . $tab[ 'title' ] . '</h2><p>Tab Content. You can display something in PHP here as well.</p>';
}
Read this tutorial to learn more about how to choose a priority
parameter.
A quick look on the arguments of the function:
$slug
– it ismisha_custom_tab
.$tab
– contains all the same parameters of an array on line 5.
Adding Multiple Product Tabs
Sometimes you may need to add two or even three custom product tabs at the same time. For the first time doing it, it may be unclear, so we will cover it in a second.
The main thing you have to keep in mind is that you do not have to use woocommerce_product_tabs
hook or a callback function multiple times. Period!
add_filter( 'woocommerce_product_tabs', 'misha_multiple_product_tabs' );
function misha_multiple_product_tabs( $tabs ) {
// first tab
$tabs[ 'misha_tab1' ] = array(
'title' => 'Suggested use',
'callback' => 'misha_tabs_callback',
'priority' => 40,
);
// second tab
$tabs[ 'misha_tab2' ] = array(
'title' => 'Warnings',
'callback' => 'misha_tabs_callback',
'priority' => 50,
);
return $tabs;
}
// we use the only callback function for all the tabs
function misha_tabs_callback( $slug, $tab ) {
// display tab heading for every tab
echo '<h2>' . $tab[ 'title' ] . '</h2>';
if( 'misha_tab1' === $slug ) {
// echo wpautop( 'Take 1 veggie capsule 1 or more times daily, with or without food.' );
// you can get the tab content from product custom fields
echo wpautop( get_post_meta( get_the_ID(), 'suggested_use', true ) );
}
if( 'misha_tab2' === $slug ) {
echo wpautop( 'Keep out of the reach of children' );
}
}
Here we are.

Conditioning Custom Product Tabs
You can also use global $product
object to create some conditions. For example you can display your tab only for a specific product:
function misha_custom_tab( $tabs ) {
global $product;
if( 5 == $product->get_id() ) {
$tabs[ 'misha_custom_tab' ] = array(
Or for specific product types:
function misha_custom_tab( $tabs ) {
global $product;
if( $product->is_type( 'variable' ) ) {
$tabs[ 'misha_custom_tab' ] = array(

Misha Rudrastyh
Hey guys and welcome to my website. For more than 10 years I've been doing my best to share with you some superb WordPress guides and tips for free.
Need some developer help? Contact me
Hi, Misha. We got lot of nice posts for #woocommerce.
But, can we ask for variable products tutorials? Ajax add to cart, changing markup of price and all these things, that are pretty uncomfortable to edit with woo.
Thanks. If not, i`ll understand.
Peace!)
Hi Andrey,
Thank you for your suggestion, I will keep that in mind :)
Is there a snippet code so that I can pull from the product long description by way of the the header tags and say assign the H2 Header Tags as separate tabs?
In other words I have a long product description with multiple H2 tags already for many products. I want to use a code to just make it so each H2 tag in the long product description shows as a unique custom tab rather than being all lumped together under the Description tab.