Show only products in storefront search results
To restrict search results on your store to products only:
From your Shopify admin, click Online Store, and then click Themes (or press
Find the theme you want to edit, click the
...button, and then click Edit HTML/CSS.
Under the Layouts folder, locate and click on the
theme.liquidfile to open it in the online code editor.
theme.liquidfile, press 'ctrl' + 'F' on a PC or 'command' + 'F' on a Mac to locate the following text:
Between the opening
<form>tag and closing
</form>tag, add the following form field:
<input type="hidden" name="type" value="product" />
Your amended file should look something like this (the exact HTML used for your search form may be different depending on your theme):
Save your changes.
Apply the same edit to your
search.liquidtemplate, and remember to save your file.
Your store's search function will now display only products. Go to your storefront to test it.