Currently I have a WooCommerce installation where product URLs are produced as such:
domain.com/shop/product-category/product-name/
Due to SEO and current site structure, I would like to change it to:
domain.com/product-category/product-name/
I know how to remove shop from the breadcrumb using the woocommerce_get_breadcrumb filter, but I am unsure how to proceed for the URLs themselves.
All I've found on Stack Overflow are people recommending to install a plugin called Premmerce. This plugin has a premium version and constantly hassles you to upgrade: Removing /product-category/ and /shop/ from URL in WooCommerce
I would like to do this programmatically from my own plugin or just functions.php