All things Shopify and commerce
Hi! Before i updated my theme this code worked for me but now i cant get my pages dont show up, and i still have the same code: Solved: Re: How to remove specific pages from storefront search results - Shopify Community
1. Do somebody know how I can make my metafields to work again? Or some other easy way to hide specific pages to not show up in search and search results?
2. Or if you just know how to hide all pages from search is thats better then nothing
Store: Reflawless.com
Hello @Kingstone
Its Artzen Technologies! We will be happy to help you today.
You can definitely hide pages from search and only search products by avoiding additional pages. You have to follow the below steps to achieve the desired result. The solution we are giving is not based on the metafields. Through this code you will only get the products on search.
Please follow the steps below: -
Step 1: Go to header.liquid file, find 'routes.search_url' and add code here:
Screenshot1 -
Step 2: Go to main-search.liquid file, find 'routes.search_url' and add code here:
Screenshot2-
Code: <input type="hidden" name="type" value="product">
Let me know if need further assistance
Regards,
Artzen Technologies
I'm also facing this issue. Now Shopify add Dawn Theme version 10, the header.liquid code is completely changed. It has no code with "routes.search_url" anymore. I can't copy paste the header.liquid from my store. Hope you can help find the solution by looking into Dawn Theme version 10. Cheers!
Hi @HadiLee
Yes, I can provide you the solution according to your theme update.
According to the latest 10.0 version of dawn you will find "routes.search_url" in the snippet file "header-search.liquid" around line number 30-32.
There you can update the code with the code provided :-
Code: <input type="hidden" name="type" value="product">
If this solution helped you then please mark it as accepted.
Let me know if need further assistance
Regards,
Artzen Technologies
we're using the Concept theme. i assumed adding a meta tag to the page and adding the code to the code would work - I'd seen this in another community chat. We want to hide specific pages from the search function. thanks
{% unless item.metafields.custom.hide_from_storefront_search == 1 %} - this is the code...
I'm a novice by the way
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024