How To Disable Search Results Page In Shopify
By default, Shopify searches all products stored in your store. This may be good if you are selling a specific product, but for stores selling multiple products, this is a big opportunity to miss. In this post, you will learn How to disable the search results page in Shopify.
The steps you will be required to follow are:
If you are using a Shopify 2.0 theme, please follow the steps below:
- In your Shopify admin, go to Online Store > Themes.
- Find the theme you want to edit and click the Customize button
- In the Customize page, let’s choose the Search page.
- You should hide the main page content section. You also can add a Custom HTML code with the content below.
1 | <script>window.location.replace("/");</script> |
- Click Save and you are done.
If you aren’t using a Shopify 2.0 theme, please follow the steps below:
- In your Shopify admin, go to Online Store > Themes.
- Find the theme you want to edit and click the … button, then select Edit code
- In the Templates directory, open search.liquid file
- Removing all existing code, then inserting the below code to this file
1 | {% layout none %}<script>window.location.replace("/");</script> |
- Click Save and you are done.
Now, if someone accesses the search results page, the browser will automatically redirect them to the homepage.
Well, here’s a quick and easy solution. Just follow these simple steps to disable your search results page in Shopify and you’ll be able to navigate to your shop as you please. Thanks for reading, and I hope you found this useful!