Support » Plugin: Relevanssi - A Better Search » Redirect to first result

  • Resolved toktor


    We have relevanssi set up for products.
    It seems for some products, after a search user is automatically redirected to the product page instead of showing all the results.

    Can someone confirm this is coming from relevanssi and is there a way to disable it / how does it work?

    I am a bit baffled. Could not find anything related to this feature either. No custom code, storefront, woocommerce and relevanssi active only.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari


    This is a WooCommerce feature. If you want to disable it, add this to your theme functions.php:

    add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );

    This feature should only trigger on search result pages with just one result.

    Thank you Mikko! Your reply helped me to solve it.

    It was issue with wrongly configured Relevanssi from our side. Without Relevanssi I got multiple results and with Relevanssi only one, but the fact that it redirected threw me off.

    • This reply was modified 1 year, 11 months ago by toktor.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect to first result’ is closed to new replies.