In WooCommerce, product pages typically display several tabs, such as “Description,” “Additional Information,” and “Reviews.” By default, the “Description” tab is the first one shown to customers. However, depending on the nature of your products, you may want to change which tab is active by default when the product page loads. For instance, if customer reviews are a key selling point, you might prefer to have the “Reviews” tab open first.
In this guide, we’ll show you how to change the default active product tab in WooCommerce without using a plugin, giving you full control over how product information is presented to customers. As always, make sure you’re adding this custom code to a child theme to protect your changes from theme updates.
Why Change the Default Active Product Tab?
Changing the default active product tab allows you to:
- Highlight Key Information: Ensure that the most important information is displayed upfront, such as customer reviews, technical specifications, or additional product details.
- Customise the User Experience: Tailor the product page to better fit your customers’ needs, based on what they are likely to look for first.
- Improve Sales: Focus customers’ attention on content that may help them make a quicker purchasing decision.
Custom Code to Change the Default Active Product Tab
The following JavaScript and WooCommerce hooks will let you set any tab as the default active one. This code can be added to your theme’s functions.php file or in your child theme.
Step 1: Enqueue Custom JavaScript to Change Active Tab
/*
* Snippet: How to Change the Default Active Product Tab in WooCommerce – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1552
* Tested with WooCommerce 10.7.0
* "This function enqueues custom JavaScript to set the default active tab on WooCommerce product pages"
*/
function wcsuccess_change_default_active_tab() {
if ( is_product() ) {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
// Remove 'active' class from the default description tab
$('.wc-tabs li').removeClass('active');
$('.woocommerce-tabs .panel').removeClass('active');
// Add 'active' class to the reviews tab
$('.wc-tabs li.reviews_tab').addClass('active');
$('#tab-reviews').addClass('active');
});
</script>
<?php
}
}
add_action( 'wp_footer', 'wcsuccess_change_default_active_tab' );
How the Code Works
- JavaScript: This script removes the “active” class from the default tab (
Description) and applies it to theReviewstab. You can change the targeted tab by adjusting the tab selector in the code. - WooCommerce Hook: The code is added to the
wp_footerhook to ensure it runs on the product page after the content has loaded.
Step 2: Changing to a Different Tab
If you want to set a different tab as the default active one, here’s how you can modify the code:
- For the “Additional Information” tab:
$('.wc-tabs li').removeClass('active');
$('.woocommerce-tabs .panel').removeClass('active');
$('.wc-tabs li.additional_information_tab').addClass('active');
$('#tab-additional_information').addClass('active');
For a Custom Tab (if you have one added via theme or plugin):
$('.wc-tabs li.custom_tab').addClass('active');
$('#tab-custom').addClass('active');
Simply replace the class names with the appropriate identifiers for the tab you want to make the default active tab.
Adding Shortcodes to Tabs
If you’d like to include shortcodes within a tab to display dynamic content (e.g., forms, special offers), you can modify the tab’s callback to use the do_shortcode() function.
For example, to include a shortcode inside the description tab:
add_filter( 'woocommerce_product_tabs', 'wcsuccess_add_shortcode_to_tab' );
function wcsuccess_add_shortcode_to_tab( $tabs ) {
$tabs['description']['callback'] = function() {
echo do_shortcode('[your_custom_shortcode]');
};
return $tabs;
}
This method dynamically inserts shortcode-supported content into the desired product tab.
Best Use Cases for Changing the Default Active Tab
- Reviews Tab as Default: If customer feedback is a key part of your sales strategy, making the reviews tab the default can help build trust with potential buyers.
- Additional Information First: For products that rely heavily on technical specifications or dimensions, it might make sense to show the “Additional Information” tab first.
- Custom Tab: If you’ve added a custom tab with promotions, warranties, or related services, making it the default can focus customers on these valuable offerings.
Conclusion
Changing the default active product tab in WooCommerce allows you to customise the user experience and focus attention on the most important information for your store. With the simple custom code provided, you can make sure that your product page highlights what matters most to your customers, whether it’s reviews, additional specifications, or custom content.
As always, test any code on a staging site before applying it to your live store, and use a child theme to ensure your changes are not lost during theme updates. If you’re looking for more WooCommerce customisation tips, check out our WooCommerce Visual Hooks Guide and wp-config generator to further enhance your store.
I have been working with WordPress and WooCommerce since 2012 and have developed a deep knowledge of the content management system. Since 2012, I have developed several plugins and designed dozens of websites utilising different frameworks, CMS’s and programming languages. I am proficient in PHP, Python, Java, C, C++, R and JavaScript with limited experience in Go, Kotlin and Swift.
Educationally, I have a Master’s degree in cyber security a Bachelor’s (Hons, First Class) in Applied Research and a Graduate Certificate in Data Science. I’m currently undertaking PhD studies investigating IoT cybersecurity. I recently graduated with First Class Honours and Masters of Information Technology, receiving the Executive Dean’s Award for studies undertaken in the 2021 and 2022 academic years. I have worked in the information technology industry for the past 11 years primarily as a software/web developer specific to design, optimisation, network management and security. My research interests are in the areas of Internet of Things (IoT), 5G and Beyond Networks, information security for wireless networks and software development.
Stay In Touch

