Want to show extra info on your WooCommerce product pages — like Refund Policies, or Product Videos? The best way to do that is by adding a custom tab.
In this tutorial, you’ll learn how to add a custom tab to WooCommerce product pages using code — no plugins required!
Why Add a Custom Tab?
WooCommerce comes with default tabs like Description, Reviews, and Additional Information. But sometimes you need more flexibility, for example:
- Display a Refund & Return Policy
- Share Shipping Info
- Embed a Product Demo Video
Let’s get started!
Add Custom Tab Using WooCommerce Filter
Use the woocommerce_product_tabs
filter to insert your own tab:
add_filter( 'woocommerce_product_tabs', 'custom_product_tab' );
function custom_product_tab( $tabs ) {
$tabs['extra_tab'] = array(
'title' => __( 'Size Guide', 'your-textdomain' ),
'priority' => 50,
'callback' => 'custom_product_tab_content'
);
return $tabs;
}
function custom_product_tab_content() {
echo '<h2>' . __( 'Size Guide', 'your-textdomain' ) . '</h2>';
echo '<p>This is the Size guide details for this product. You can insert images, tables, or any HTML here.</p>';
}
This code adds a new tab called Size Guide after the default tabs.
Make the Tab Conditional
Want to show the tab only for specific categories or products? No problem!
Example: Show Only for Products in “Clothing” Category
function custom_product_tab( $tabs ) {
global $product;
if ( has_term( 'clothing', 'product_cat', $product->get_id() ) ) {
$tabs['extra_tab'] = array(
'title' => __( 'Size Guide', 'your-textdomain' ),
'priority' => 50,
'callback' => 'custom_product_tab_content'
);
}
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'custom_product_tab' );
Need More Flexibility?
you can make the tab content dynamic by fetching custom fields or meta data.
Load from a Custom Field
function custom_product_tab_content() {
global $post;
$value = get_post_meta( $post->ID, '_your_meta_key', true );
echo wp_kses_post( $value );
}
Final Thoughts
Adding a custom tab to WooCommerce product pages is a powerful way to provide helpful info to your customers. Whether it’s size guides, policies, or videos — it improves user experience and can boost conversions.