Redirect to a page while maintaining search query parameters without causing an infinite loop
We are making use of a plugin called Product Filter by XforWoocommerce. It has a feature that limits the available product filter options based on what products are visible, however, it does not work on search queries. Rather than try to make a large custom edit that is potentially difficult to maintain I came up with this solution:
Any time a search query is made, redirect to the main product category page that matches most of the results.