How to remove blogs & pages from my in-store searching result

I have searched the similar question in the community. The answer is to edit the store theme code. I have tried to follow the instruction, but I have no experience in code editing.

I am using the theme ‘Dawn’. Does anyone know where to edit the code? I am following the link on this page: https://shopify.dev/themes/navigation-search/search but still have no idea where to add the code.

1 Like

Hello @KATZZ

  1. Open your admin panel.
  2. Click on online store.
  3. Then click on action button in the dropdown click on Edit code.

Hello @KATZZ

I would like to give you some recommendations to support you

You can follow these steps:

  1. Go to Online Store->Theme->Edit code
  2. Open your header.liquid theme file
    Please search with keywords: 'search__button ’

add the code just above the button


Hope my recommendation can works and support for you! Kind & Best regards! GemPages

Hello @KATZZ ,

This is flareAI: your Fully Automated Free Sales Machine. I hope you’re having a good day. flareAI is helping lots of successful Shopify stores generate $5+ million in sales from Google Search, on autopilot.

If my suggestions is helpful to you, please let me know by giving a like or marking it as a solution.

You can restrict the Shopify search to show only product pages.

To achieve a custom search, you can add a hidden field in the header.liquid file.

Go to your Online Store > Themes > Edit code > header.liquid file

Find ‘routes.search_url’ and add the hidden field inside the section.


Similarly, go to *main-search.liquid* file, find 'routes.search_url' and add a hidden field there also:

```markup

This will restrict giving only product pages in the storefront search result.

You can read [this blog](https://www.shopify.com/in/partners/blog/custom-search) for more details.

Hope this helps,

Gina
[flareAI](https://apps.shopify.com/flareai-seo)
1 Like

Thanks! It is very clear. I have successfully edited it.

1 Like

what should the value be if i want to include products and pages but exclude only blog articles?

i think i figured it out. to include product and pages (but not blog articles):

1 Like

Question - what line did you replace or add that code you posted in? Still having trouble removing only blog/press posts from my site. Thanks for your help, it would be much appreciated!

I hope this helps, dawn theme, install “Search & Discovery” - it’s completely free, from search and discovery app go to Settings and uncheck “Blog” in what to include in the in-search. like so:

1 Like

Thanks for the assistance! Any idea if that works with the ‘Impact’ theme?

As i’ve untoggled that box but press/“blog posts” are still showing in search engine.

No idea, but I think it should maybe wait for 5 minutes?