How to remove non-product pages from website search results?

Topic summary

A user wants to exclude non-product pages from appearing in their website’s search results, showing only products. Two solutions are offered:

Solution 1: CSS Hide Method

  • Add CSS code to the theme.liquid file’s <head> section that visually hides pages from search results
  • Note: This only hides pages visually, doesn’t remove them from search indexing
  • Complete removal requires deeper theme file modifications

Solution 2: Search & Discovery App (Recommended)

  • Install Shopify’s free Search & Discovery app
  • Access settings to uncheck the option for displaying pages in both standard and predictive search results
  • This appears to be a cleaner, no-code solution

Follow-up Question:
Another user asks whether it’s possible to selectively hide specific pages rather than excluding all pages entirely—this remains unanswered.

Summarized with AI on November 2. AI used: claude-sonnet-4-5-20250929.

When i search on my website, my products come up, but pages on my website also come up too, how can i remove these and make it that just products that come up?

Theme:Dawn

Website: Desire-online.net

Hi @jakegrieveson ,

Please add below code on the head of theme.liquid file to hide the pages from search page. This will just hide the pages. If you want to completly remove the page from the search, this will require implementing changes on the theme file which will require access to your site.

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code just above tag

{% if template == 'search' %}

 {% endif %}

If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

Best Regards,
Makka

The easiest way to do this is through Shopify’s free Search & Discovery app:
https://apps.shopify.com/search-and-discovery

After installing the app you can go to the settings and uncheck the box to stop it showing Pages in both search results as well as predictive search.

is there a way to hide certain pages from the search and not just all of them altogether?