I dont know if this information is correct or where to implement this code.
Under Settings, Metfield, Product,… it doesn’t appear that you can individually select a product.
If somebody knows how to do this, or another way to hide a product from the search bar, but keep it live on your store please let me know. Id like to hide 10 products and im sure i can figure it out after receiving instructions for 1.
Thanks for your time
I want to hide 10 products, once i learn how to hide one, im sure i can do the rest easily.
the instructions you read around are indeed correct.
Please follow this guide. I’ve just tested on Minimal Theme and it works and it should work on all themes, if they are implemented following Shopify guidelines.
Go to your backend in Settings > Metafields and click Products
Click Add Definition to add a new product metafield.
Name: Metafield name (e.g. Hide Product)
Namespace and key: seo.hidden
Description: up to you
Type: Number [Integer]
Thank you very much for your quick support. If you dont mind quickly going over this with me it would be greatly appreciated. I havnt changed much code or added anything like this before so i want to make sure im correct and dont mess up my store.
First I go to Settings-Metafeilds
Then I manually fill in the following:
Name: Hide Product
Namespace and Key: seo.hidden
Description: use to hide products from internal search and sitemap
Select: number and integer
Validation: (Do i select minimum 1 and leave max blank?)
Once this is completed i click save.
Then, how do i add the specific products that I want hidden to this rule? I have numerous products but i only want to hide 10 of them… Also, customers can still purchase these right? I only want them hidden from search.
I apologize for all the questions and any further possible help would be greatly appreciated.
This didn’t work for me. It look a little different now, asking if you want to expose it to an API, if you want 1 value or a list of values… I set it up right, went to edit the product I’d like to be hidden from the search, & entered the number 1 in the metafield, but it still shows in a search. Anyone know what I’m doing wrong here?
Did this exact same thing, even went word for word in the description, & it just won’t work for me. I cleared my cache & cookies, I waited 20-30 min to see if it just needed some time, it just doesn’t want to hide for some reason. I’m only trying to hide 2 products, but the universe is saying “nah, bro…not on my watch!” Can you think of anything else it could be? There is a metafield that is already using numbers —> Integer for products, could that be it?
When I use the setting seo.hidden = 1 it does both for me. It exclude it from the internal search and also setting the meta robots from index to noindex () Maybe it depends on the theme??
Do you have an idea, for only disable a product for the internal search?
@Fry , I think you are right that it may be theme dependent. When I was using the Minimal theme, I used the metafield for seo and some other code (link in my previous post) for internal search. Now that I’m on a 2.0 theme (Dawn), the metafield is blocking products from internal search without the additional code.
Is it possible to do this for collections as followed the same guidelines but added on collections custom data but when searching it still shows through the search.
Collection - Is it possible to do this for collections as followed the same guidelines as above for products but for collections but when searching it still shows through the search. Is there a way using this method to hide the collections from search.
One method for hiding collections from search results involves modifying the code in search theme file of a Shopify theme. By utilizing custom code, you can apply filters to the search results to hide specific collections from being displayed in search suggestions. For example, here is the result for us after adding the custom code in predictive-search.liquid file for filtering the results in the Sense theme of Shopify -