Here is a jQuery solution for a WooCommerce accordion style menu for the product category menu that can be assigned with a WooCommerce widget, the menu works best when all product categories are assigned to a parent category.

The Accordion menu will then expand and collapse on click with the first parent category appearing expanded, the count span also has a link to the child category archive page. I have come across the original code (which I have modified)  on a site with no credit/author reference.

The toggle icons have been marked up with FontAwesome5 regular free icons, so either have that loaded or change the markup for something else.


  1. Werbeagentur on October 3, 2020 at 10:44 am

    Works great!

  2. M on July 16, 2020 at 2:50 pm

    where shall this script go into please?

  3. Mark on March 27, 2020 at 9:22 pm

    I couldn’t get this to work.

  4. Mark on March 27, 2020 at 9:11 pm

    Have you or anybody else ever taken the filters from WC and made those into an Accordion?

    I’ve been looking and looking and can’t find anything. Thanks in advance!

  5. Lance on February 24, 2020 at 2:32 am

    Appreciate the tip. Worked great for me!

  6. D on February 28, 2019 at 4:35 pm

    Sweet, works lika a charm.
    -How to keep them all closed by default?

Leave a Comment