Online Forum To Support Coders With Technical Assistance - Read Write Execute

How to disable redirect to product page instead of search page in woocommerce

Ankit Agrawal
Ankit Agrawal
Published on March 11, 2022 · 1 min read

If there is only one result while searching then woo-commerce redirects a user directly to the product page. It’s woo-commerce’s default feature. We can disable it by using the following code :


add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );

Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article What is the difference between –save and –save-dev in Node.js ? Next Article → List of all CTRL Shortcuts ( A to Z)