Re: New update on theme! Cant hide pages from search - Refresh/Dawn

New update on theme! Cant hide pages from search - Refresh/Dawn

Kingstone
Excursionist
41 2 6

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

Replies 4 (4)

Artzen_tech
Shopify Partner
552 113 112

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 -

Artzen_tech_0-1678082622161.png

 


Step 2: Go to main-search.liquid file, find 'routes.search_url' and add code here:
Screenshot2-

Artzen_tech_1-1678082640957.png


Code: <input type="hidden" name="type" value="product">

Let me know if need further assistance
Regards,
Artzen Technologies

If helpful, please Like and Accept this Solution to help others
Artzen Technologies | A Shopify Development Agency
WhatsApp - 9877983930

Book FREE CONSULTATION who want to migrate to Shopify or want to start an eCommerce business with Shopify
HadiLee
Visitor
2 0 1

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!

Artzen_tech
Shopify Partner
552 113 112

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

If helpful, please Like and Accept this Solution to help others
Artzen Technologies | A Shopify Development Agency
WhatsApp - 9877983930

Book FREE CONSULTATION who want to migrate to Shopify or want to start an eCommerce business with Shopify
Thebigyun
Visitor
2 0 0

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