Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BFTrick/6429700 to your computer and use it in GitHub Desktop.
Save BFTrick/6429700 to your computer and use it in GitHub Desktop.
A filter to disable the default functionality where WooCommerce redirects a product search with only one result to the product page.
<?php
add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );
@skylarkcob
Copy link

It doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment