I've got a site with a very large number of custom taxonomies. The site uses FacetWP to allow uses to drill down through those taxonomies. Instead of sending users to taxonomy-{taxonomy}.php
when they click a linked term/taxonomy, I'd like to send them to the search with that specific facet applied. FacetWP makes this very easy with query strings.
It seems silly to use wp_redirect()
and have 301 redirects for hundreds and hundreds of items. Is there an easier way to programmatically replace what Wordpress considers the destination for term and taxonomy archives?
I've got a site with a very large number of custom taxonomies. The site uses FacetWP to allow uses to drill down through those taxonomies. Instead of sending users to taxonomy-{taxonomy}.php
when they click a linked term/taxonomy, I'd like to send them to the search with that specific facet applied. FacetWP makes this very easy with query strings.
It seems silly to use wp_redirect()
and have 301 redirects for hundreds and hundreds of items. Is there an easier way to programmatically replace what Wordpress considers the destination for term and taxonomy archives?
I'm not familiar with how FacetWP displays search results, but if it's using the default (or a custom) search.php template, you could use a template filter to hijack the default hierarchy. See the Filter Hierarchy section of the Template Hierarchy page for examples. If you want more specific help update your question to show how you'd do this via wp_redirect()
and we can help switching out the method.