A Shopify store owner using the Debut theme wants to prevent internal pages from appearing in their site’s search results while keeping products and articles searchable.
Initial Problem:
Pages contain internal information not meant for customers
Standard SEO hiding methods don’t address on-site search functionality
Technical Solution Provided:
User mit_1 suggested adding a hidden input field to search forms:
This code should be placed in search-form.liquid and search.liquid templates, right below the opening <form> tag. It limits search results to only products and articles, excluding pages.
Additional Workarounds:
Create an alternate page template with minimal/no content and redirect functionality
Add visually-hidden class to page results in search.liquid to hide title and description
Use metafields (seo.hidden) to hide from search engines entirely
Assign special tags to pages for filtering
Simpler Alternative (Post #14):
Download Shopify’s “Search and Discovery” app, which provides a settings interface to easily select which content types appear in search results—no coding required.
Status: Resolved with multiple working solutions confirmed by the original poster.
Summarized with AI on November 12.
AI used: claude-sonnet-4-5-20250929.
Using debut. I use pages to contain internal information. I don’t want customers to see any pages in search results at all. How can I hide all pages from search results?
I definitely understand why you need to hide this private information. You can do so following our tutorial here. This will prevent the pages you’d like from being searchable while not affecting the public pages. For example, if you have an About Us page that you’d like to keep searchable.
For the pages that contain internal information, are you publishing them? If you don’t need them to be published you can follow this guide to unpublish them. This way there is no risk of customers being able to see them.
How has your 2020 been for your business so far? Since we’re now into the new year, have you been able to put into practice anything that you’ve learned from last year? Or perhaps you had a big win in 2019 that you’d like to try to beat! I’m not sure if you’re familiar with our Shopify Academy courses, but we have a new one for Goal Setting that is great for this time of year.
Let me know if you have any further questions! I’d be happy to continue helping you.
Hi @Dani@thanks for your reply but i should clarify…I need to hide search results from my own search results on my website. This tutorial doesn’t help my situation because I’m trying to hide search results from search.liquid not search engines. For example if I have a page called ABC I don’t want customers to see and someone searches ABC into the search bar on my site I don’t want page ABC to appear. Hoping that makes sense.
Hey thanks for this help! I looked over the link you sent and I do want to set my site search to not look for pages at all, but I can’t figure out where to put your code:
Check search-form.liquidsnippet and search.liquidtemplate (as far as I remember only these two), and paste my code somewhere right below the opening <form …> tag.
No, that’s exactly opposite – you need to keep in that tag those types which you want to be searched – I gave you the code you should use if you want to search only products and articles.
And as always – share the (preview) url to your shop – this will help troubleshooting.
Not my customers in general, no, but a super cool savvy particular customer…possibly :/, and I definitely don’t want customers having access to those internal pages (of course those pages don’t contain sensitive info…but prefer customers not to be able to see them)…
I’m not sure how to go about your suggestion, any ideas?
Another workaround I’m wondering is: on my Search results, I show the Image, Title, and Body/Description of products, pages, etc. Can I hide just the title and body/description of the pages only so that if said super cool savvy particular customer searches the page, it comes up blank?
Just an update for anyone that may be interested…here’s how I totally eliminated pages from the search page if users typed the page name into the search box or used an URL.
I used Tim’s code to eliminate all pages from search results. This made only products and articles come up with the title and description of each item. I only need products in search results to come up. Only minor problem was, if users used URL to search (highly unlikely but best to cover all bases), they could still see the page title and page content if they typed this: mywebsite.com - This website is for sale! - mywebsite Resources and Information. into the url.
To eliminate this issue I used this code on my search.liquid:
{% for item in search.results %}
<li class="list-view-item">
{% if item.object_type == 'product' %}
{% include 'product-card-list', product: item %}
{% else %}
<span class="visually-hidden">
I added span class visually hidden to everything else and closed with:
</span>
Furthermore, if by some chance customers got to the page…I wanted the page to redirect to the contact page. So I followed Tim’s solution code in this thread.
Hey Tim - I’m somewhat new to liquid but have experience from way back using HTML and CSS… I have a large number of individual ‘profile’ pages that I need to assemble but I’m not decided which format (pages or blog articles) might work best. I came across this article as a way to troubleshoot the issue I’m finding with the pages approach…
I have arranged a collapsible content section. Each row only links to a page, so I made a page with a few links (to be expanded with images and text if I can make this work) that redirect to the individual profile pages. The issue I’ve found with this approach is that my intermediary pages, that only exist to be loaded within the collapsible section, are showing up on test searches for my basic search terms.
Is this code suitable for hiding those intermediary pages from showing on the search results?
A ) Set up the profiles under the Blog option and find a way to hide the date, published by, and then re-phrase the ‘Back to Blog’ text to read as "back to ___ " instead
B ) Set up the profiles as Products, but be able to hide/remove the price and buy button from those select ‘products’
I feel both A & B would better integrate with the search function without needing to start playing with code… but don’t really know how to use the code or where. Can I add in just the above snippet without needing to have the whole page coded, or can I simply use the Liquid code as needed?
Attached is a visual of the collapsible function as I have it now, and then the search results using the blog to host the test profile
please ignore the mess, I’m still playin’ with it.
FOUND A MUCH EASIER SOLUTION NO CODING NEEDED – download search and discovery app by shopify - under settings remove all boxes checked besides “products” so easy to select what you want showing up under my sites search - i only wanted products not pages.