Trying to customize a WooCommerce product page can be quite a challenge. I’ve faced this myself, especially when working on a client’s site with the Enfold Theme. The default setup only had a description and a review tab. However, my client needed six unique tabs for each product. Does this sound familiar?
Luckily, I found an easy way to add custom tabs to WooCommerce product pages. This method allows you to include all the extra details your customers need without cluttering the main product information.
In this guide, I’ll show you how to add custom tab in WooCommerce product page (step-by-step). This will make your product pages more detailed and user-friendly.
Let’s get started!
If any aspect of WooCommerce development feels overwhelming, don’t hesitate to reach out to us for a free consultation.
Table of Contents
1. How Adding a Custom Tab Enhances User Experience
2. Step-by-Step Guide to Add Custom Tab to a WooCommerce Product Page
○ Step 1: Add a Custom Tab to the Product Page
○ Step 2: Add Content to the Custom Tab
○ Step 3: Reorder Custom Tabs
○ Step 4: Adding Data from the Custom Tab to the Cart (Optional)
3. Best Practices for Adding a Custom Tab to a WooCommerce Product Page
4. Conclusion
What Exactly Are Custom Tabs in Product Pages?
Before we dive deeper, let’s clarify what WooCommerce custom tabs are in product pages. Custom tabs in WooCommerce product pages are additional sections you can create to organize and present more information about your products.
By default, WooCommerce product pages come with standard tabs like ‘Description’ and ‘Reviews’. However, custom tabs allow you to add new sections such as ‘Specifications’, ‘FAQs’, ‘Usage Instructions’, or any other relevant information specific to your product.
These WooCommerce tabs help keep your product page clean and organized, making it easier for customers to find the information they need without scrolling through lengthy descriptions. Custom tabs can be tailored to fit the unique needs of each product, enhancing the overall shopping experience.
How Adding a Custom Tab Enhances User Experience
Now that we’ve covered the importance of adding a custom tab to a WooCommerce product page, let’s dive into how it specifically enhances the user experience.
- Clear and Organized Information: Separate tabs for product specifications, usage instructions, FAQs, and reviews keep the page tidy and easy to navigate.
- Focused Content Presentation: Each tab focuses on specific information, allowing customers to quickly find what they need, such as technical specs or usage instructions.
- Improved Navigation: Users can effortlessly switch between tabs, avoiding the need to scroll through long pages and reducing frustration.
- Enhanced Aesthetic Appeal: A clean, well-organized page looks more professional and user-friendly, making a positive visual impression.
- Interactive and Engaging: Tabs can include videos, image galleries, or other interactive content, engaging users more effectively than plain text.
- Tailored Information: Customize tabs based on product type to provide relevant information, improving the overall shopping experience.
Guide to Add Custom Tab to a WooCommerce Product Page
We can add custom product tabs in WooCommerce in two major ways:
- Using a plugin
- Programmatically
Let’s explore both methods. We’ll start with the plugin method.
Add Custom Product Tabs Using a Plugin
Using a plugin is a user-friendly way to add custom product tabs without touching any code. One of the most popular plugins for this is Custom Product Tabs for WooCommerce by YIKES, Inc.
Option 1: Custom Product Tabs for WooCommerce Plugin
This plugin comes in both free and premium versions. The free version covers basic needs, while the premium version offers advanced features, starting at $29.99 per year with updates and support.
Steps to Add Custom Product Tabs Using the Plugin
- Install and Activate the Plugin:
- Go to your WordPress dashboard.
- Navigate to Plugins > Add New.
- Search for “Custom Product Tabs for WooCommerce” by YIKES, Inc.
- Click “Install Now” and then “Activate.”
- Add Custom Product Tabs:
- From your dashboard, go to Products > All Products.
- Hover over the product you want to edit and click “Edit.”
- Scroll down to the Product Data section and click on “Custom Tabs.”
- Click “Add a Tab,” then specify the Tab title and content.
- You can add multiple tabs and reorder them as needed. Click “Save Tabs” to save your changes.
Using Saved Tabs for Efficiency
Adding custom tabs to multiple products individually can be time-consuming. The plugin’s Saved Tabs feature lets you create tab templates that you can reuse across different products.
- Create Saved Tabs:
- Go to your dashboard and click on Custom Product Tabs.
- Click “Add a Tab” and fill out the form with the tab title and content.
- Save the tab for later use.
- Add Saved Tabs to Products:
- On the Product Edit page, scroll to Custom Tabs.
- Click “Add a Saved Tab” and select the desired tab from the list.
- Customize the content if needed, then save the changes.
This method makes it easy to manage and reuse tabs across your products, ensuring consistency and saving time.
Option 2: Add Custom Product Tabs Programmatically
Step 1: Add a Custom Tab to Product Page
To add a custom tab, you’ll need to use the woocommerce_product_tabs filter provided by WooCommerce. This code should be added to the functions.php file of your theme.
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' ); function woo_new_product_tab( $tabs ) { // Adds the new tab $tabs['desc_tab'] = array( 'title' => __( 'Additional Information', 'woocommerce' ), 'priority' => 50, 'callback' => 'woo_new_product_tab_content' ); }
This code snippet will add a new tab titled “Additional Information” to the product page. After implementing this code, your product page should now display the new tab alongside the default tabs.
Step 2: Add Content to WooCommerce Custom Tab
Once the custom tab is added, you need to fill it with content. This can be done in two ways: by adding static content or by fetching content from custom fields in the admin dashboard.
Option 1: Add Static Content
If you want to add static content to the custom tab, use the following code in the functions.php file:
function woo_new_product_tab_content() { // The new tab content echo '<p>Lorem Ipsum</p>'; }
Option 2: Fetch Content from Custom Fields
If you prefer to use content from custom fields provided in your admin dashboard, use this code:
function woo_new_product_tab_content() { // The new tab content $prod_id = get_the_ID(); echo'<p>'.get_post_meta($prod_id,'additional information',true).'</p>'; }
Step 3: Reorder Custom Tabs
You might want to reorder the custom tabs based on your preference. To do this, you need to use the woocommerce_product_tabs filter again. Add the following code to the functions.php file:
add_filter( 'woocommerce_product_tabs', 'sb_woo_move_description_tab', 98); function sb_woo_move_description_tab($tabs) { $tabs['desc_tab']['priority'] = 5; $tabs['reviews']['priority'] = 20; return $tabs; }
Using the above method, a user can be provided with plenty of content without cluttering the product page. Arranging the data logically not only makes it simpler for the website visitor to understand the features of the product but it also becomes easier for the web admin to maintain the uniformity in data across the product.
This code snippet will change the order of the tabs by setting new priorities. The ‘Additional Information’ tab will appear first, followed by the ‘Reviews’ tab.
Step 4: Adding Data from the Custom Tab to the Cart (Optional)
If the information from your custom tab needs to be added to the cart (e.g., personalized product details), you might want to integrate this with your cart functionality. For detailed instructions on how to add custom data to the cart, refer to the guide on How to Add Custom Data to WooCommerce Cart.
Best Practices for Adding a Custom Tab to a WooCommerce Product Page
When adding a new tab to a WooCommerce product page, following these best practices ensures a smooth and effective process:
- Keep the User in Mind: Design custom tabs with the end-user in mind. Make sure the information is useful and easy to find, enhancing their shopping experience.
- Use Clear and Descriptive Titles: Avoid vague titles. Use straightforward ones like ‘Product Details,’ ‘Customer Reviews,’ or ‘FAQs’ to help customers find what they need.
- Maintain Consistency: Ensure a uniform format and style across all product pages. Consistency helps customers navigate easily and creates a professional look.
- Optimize for SEO: Include relevant keywords in the tab content to improve your product page’s search engine visibility.
- Test Thoroughly: Before going live, test your custom tabs on a staging site. Ensure they display correctly on all devices and browsers without interfering with other site functionalities.
By following these tips, you can effectively add custom tabs to WooCommerce product pages, improving user experience and boosting your online store’s appeal.
Final Thoughts
Adding custom tabs to your WooCommerce product pages can really change how you present product information and make things much easier for your customers. By following the steps and best practices we’ve covered, you can create a more organized, informative, and user-friendly shopping experience.
Custom tabs let you showcase detailed product info, manage out-of-stock items better, and keep your product pages looking clean and professional.
If you run into any issues or need more help customizing your WooCommerce store, don’t worry. Our team of WooCommerce experts is here to help. Reach out to us for personalized assistance and we’ll make sure your online store runs smoothly and efficiently. We’re happy to support you in optimizing your product pages and enhancing your eCommerce site.
Also Read : Reorder Content on WooCommerce Single Product Page
FAQs
1. How can I add a custom tab to WooCommerce product pages?
To add a custom tab to WooCommerce product pages, you can use the woocommerce_product_tabs filter. Add the following code to your theme’s functions.php file:
add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ );
function woo_new_product_tab( $tabs ) {
$tabs[‘desc_tab’] = array(
‘title’ => __( ‘Additional Information’, ‘woocommerce’ ),
‘priority’ => 50,
‘callback’ => ‘woo_new_product_tab_content’
);
return $tabs;
}
function woo_new_product_tab_content() {
echo ‘<p>Custom tab content goes here.</p>’;
}
This code will create a new tab titled “Additional Information” on the product page.
2. What are the best plugins for adding custom tabs in WooCommerce?
Some of the best plugins for adding custom tabs in WooCommerce include WooCommerce Custom Product Tabs Lite, YIKES Custom Product Tabs for WooCommerce, and WooCommerce Tab Manager. These plugins offer user-friendly interfaces and various customization options to easily add and manage custom tabs on your product pages.
3. Can I add multiple custom tabs to a WooCommerce product page?
Yes, you can add multiple custom tabs to a WooCommerce product page. You can either do this manually by adding multiple entries in the woocommerce_product_tabs filter in your functions.php file, or you can use a plugin like “WooCommerce Custom Product Tabs Lite” which allows you to add and manage multiple tabs easily through the WooCommerce interface.
4. How do I customize the content of a custom tab in WooCommerce?
You can customize the content of a custom tab in WooCommerce either by adding static content directly in your functions.php file or by pulling dynamic content from custom fields. For example, to display content from a custom field, you can use the following code:
function woo_new_product_tab_content() {
$prod_id = get_the_ID();
echo ‘<p>’ . get_post_meta($prod_id, ‘additional information’, true) . ‘</p>’;
}
“
7 Responses
Thank you for posting this. Will be testing it shortly.
I found this very useful IF you want a tab displayed on every product. But not very useful for my client who is building products and adding content via the admin.
add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ );
function woo_new_product_tab( $tabs ) {
// Adds the new tab
$tabs[‘desc_tab’] = array(
‘title’ => __( ‘Additional Information’, ‘woocommerce’ ),
‘priority’ => 50,
‘callback’ => ‘woo_new_product_tab_content’
);
}
This code is Nicely work in Woocommerce product page.Thank you
if anyone is wondoring why its not working, you need a return at the end
add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ );
function woo_new_product_tab( $tabs ) {
// Adds the new tab
$tabs[‘desc_tab’] = array(
‘title’ => __( ‘Additional Information’, ‘woocommerce’ ),
‘priority’ => 50,
‘callback’ => ‘woo_new_product_tab_content’
);
return $tabs;
}
@mahathun thank you so much!!!
Author post should update the article with your code.
Thanks again.
I cant seem to link directly to the tabs, any way to fix this?
Dear all,
I successfully added one tab by following above.
What do i do if I have to add more than one such custom tabs.
I tried using the same code twice but it doesn’t work.
Appreciated.