Solved

Hide pages from search results

koze
Excursionist
19 2 5

Hey everyone,

 

I'm looking to only show products in my store search results.

 

How would I hide pages,articles,etc in the results. How do I block that?

 

I've managed to find out what to do I'm just not sure where to add or edit the code to make it work: https://help.shopify.com/en/themes/development/search/storefront-search

 

Thanks in advance!

 

Accepted Solution (1)
koze
Excursionist
19 2 5

This is an accepted solution.

Yeah I figured it out.

View solution in original post

Replies 3 (3)

iDoThemes
Trailblazer
207 43 91

Hi,

 

You aren't far off, re: the docs you'll see this line:

iDoThemes_2-1639610589241.png

 

You'll need to find your search form, it should be in one of the search related liquid files.  Adding the line above and/or if you already have it, modifying it so that value only contains product.

 

The other issue you might have is if your theme has live/ajax search, then you'll also need to modify that, though that will be more specific to the theme you are using.

Developer of Liquify Chrome Extension -- Enhance the Shopify Theme Code Editor
.




Theme Developer -- Drop me a line
koze
Excursionist
19 2 5

This is an accepted solution.

Yeah I figured it out.

fostino
Excursionist
16 1 11

@koze 

 

can you please share code and how to do???

 

Thanks