I am using Magento 2.3.1 and the pearl theme. My site has many different categories and I wanted to know if there is a way to have magento automatically remove categories that don't have product in them from the menu. I don't need them to be "disabled", just not visible.
Preferably also by level, as I use some of the root categories for other things besides products (due to brand licensing). I have looked at this question: here. However, that looks like it's Magento 1.7 and it also seems like a lot of work for something like this.