Expand WooCommerce Product Category

How to Collapse/Expand WooCommerce Sidebar Product Category list in Flatsome WordPress Theme

When it comes to navigating your site visitors to your desired product categories and subcategories, you should expand WooCommerce product category and subcategories automatically.

Generally, when you develop your website using Flatsome WooCommerce theme, you may notice that all WooCommerce Sidebar product subcategories are not collapsed. Like the following screenshot.

Not Collapsed WooCommerce Product Category

Website visitors have to expand it their own. Consequently, many visitors don’t expand the list and leave the site. To keep all Woocommerce product category list collapsed or expanded in Flatsome WordPress theme follow this tutorial. After implementing my guideline, your product categories widget area would like following screenshot.

collapse product Category

How To Expand WooCommerce Product Category List In Flatsome Theme

For your convenience, I’ve divided the entire process into simple steps. To get the process, make you have Flatsome child theme activated. Otherwise, your custom code in Flatsome parent theme may disappear for the version update.

Step 01: Navigate To Global Settings

Flatsome WooCommerce theme comes with an option called Global Settings. The setting allows you to insert scripts in Header, Footer, Top of the Body and Bottom of the Body tag,

To get inside the Global Settings, navigate to Flatsome >> Advanced Settings >> Global Settings.

Global Settings

Step 02: Copy JS Code from Gist

Copy the following code

Step 03: Paste JS Code To Header Script Box

Now paste the copied code inside the Header Script box

After adding JS code inside Header Script box, press the save All Changes button


In this tutorial, you came to know how to expand WooCommerce sidebar product category widgets list. These tactics help you to grab your visitor attention and allure them to check your available categories with clicking anywhere.

If you need any tutorial on a certain topic related to WooCommerce, let me know in the comment below. I’ll write the next tutorial for you.