Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello, I am using the shopify's free Dawn theme at the moment and I sell printed merchandise on my store but I also have several pages and articles for SEO purposes.
Whenever I search a term on my search bar from home on the website, the results are not just products but also blogs and pages that contains the search term. This looks extremely untidy and irrelevant (check screenshot where the first 3 results are pages before the 1st product is displayed on searching "t shirt" from the home page search bar)
I want to just display the products in search results, pages and blogs have their own navigation menu that shouldn't appear in search results.
Can anyone help me with this? I searched on Google and scrolled through many articles where I found a single line code to block the pages and articles but there is no clear indication of where to exactly put that code. When I paste it into search.liquid file, I just can't get rid of my problem. Any help and suggestions will be much appreciated. Thank you.
Solved! Go to the solution
This is an accepted solution.
Hi @Nishant24,
Please follow the steps below:
- Step 1: Go to header.liquid file, find 'routes.search_url' and add code here:
- Step 2: Go to main-search.liquid file, find 'routes.search_url' and add code here:
Code:
<input type="hidden" name="type" value="product">
Refer: https://shopify.dev/themes/navigation-search/search#the-search-form
Hope it helps!
I've been trying to find a solution to this issue as well. Please let me know if you're able to fix it.
This is an accepted solution.
Hi @Nishant24,
Please follow the steps below:
- Step 1: Go to header.liquid file, find 'routes.search_url' and add code here:
- Step 2: Go to main-search.liquid file, find 'routes.search_url' and add code here:
Code:
<input type="hidden" name="type" value="product">
Refer: https://shopify.dev/themes/navigation-search/search#the-search-form
Hope it helps!
Hi @LitExtension, it has worked on my desktop view, but on my mobile it's still having the same problem. Is there a problem?
Hello @LitExtension , thank you so very much for solving this query for me. Now there are no issues in the delivery of search results.
It worked for me, Thank you!
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025