How to Change the Default Active Product Tab in WooCommerce – 2026

Last updated on October 17th, 2024 at 06:11 am

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 the Reviews tab. You can change the targeted tab by adjusting the tab selector in the code.
  • WooCommerce Hook: The code is added to the wp_footer hook to ensure it runs on the product page after the content has loaded.
See also  How to Display Sale Price End Date at Shop & Single Product Page in WooCommerce - 2026

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.
See also  WooCommerce: Display Prices as Was – Now – Save - 2026

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.

0 0 votes
Article Rating

Stay In Touch

Was this post helpful? Why not show your support and buy me a coffee?

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Scroll to Top
0
Would love your thoughts, please comment.x
()
x
×