How to prevent Blogs showing up during in-store search

Topic summary

A user encountered an issue where blog posts appear as products in search results when using the Maxdino Shopify theme. Clicking these results redirects to blog pages instead of products.

Initial Solutions Attempted:

  • Editing the search.liquid template file was suggested
  • A code snippet was provided to filter out blog results using {% if result.object_type != 'blog' %}

Resolution:
The provided code modification did not work with this specific template. The original poster ultimately resolved the issue independently by exploring the Search and Discovery app settings in Shopify, which allows configuration to exclude blogs and pages from search results.

Key Takeaway:
For Shopify themes, adjusting search result types (products only vs. including blogs/pages) can often be managed through the native Search and Discovery app rather than requiring custom code modifications.

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

Hi anyone can help me with this annoying thing. When you do a search within the Maxdino theme the blogs show up like a product and when you click you end up seeing the blog… i know you could maybe edit the search.liquid … can someone help ?

{% comment %}

The {{ content_for_header }} in theme.liquid will output the following stylesheet just for this page:
- <link rel="stylesheet" href="/global/search.css" type="text/css">

It has a few helpers in there, but this theme writes its own styles so there
are no dependencies or conflicts. You can ignore that file.

Return only products or pages in results:
- http://docs.shopify.com/manual/configuration/store-customization/return-only-product-in-storefront-search-results
- Or manually add type=product or type=page to the search URL as a parameter

{% endcomment %}

{% comment %}
If you're only showing products with the method above, why not show them off in a grid instead?
Set grid_results to true and see your updated results page for the new layout.
{% endcomment %}
{% assign grid_results = false %}

{% comment %}
Check to enforce respond.js
{% endcomment %}
{% assign respond_js_secret_key = shop.domain | md5 %}
{% unless search.terms == respond_js_secret_key %}

{% if search.performed %}

{% comment %}
Avoid accessing search.results before the opening paginate tag.
If you do, the pagination of results will be broken.
{% endcomment %}
{% paginate search.results by 10 %}

{% comment %}
We don't have any results to show. Feel free to show off featured products
or suggested searches here.
{% endcomment %}
<div class="search-products">
<div class="searchpb">
{% if search.results_count == 0 %}
<h5>{{ 'general.search.no_results_html' | t: terms: search.terms }}</h5>
{% include 'search-bar' %}
{% else %}
<h5>{{ 'general.search.results_for_html' | t: terms: search.terms }}</h5>
{% include 'search-bar' %}
</div>

{% comment %}
Each result template, based on the grid_layout variable above
{% endcomment %}
{% if grid_results == false %}
<div class="row">
{% for item in search.results %}
{% include 'search-result' %}
{% endfor %}
</div>
{% else %}
<div class="grid-uniform">
{% for item in search.results %}
{% assign grid_item_width = 'wide--one-quarter post-large--one-quarter large--one-quarter medium--one-third small--one-half' %}
{% include 'search-result-grid' %}
{% endfor %}
</div>
{% endif %}
{% endif %}

{% if paginate.pages > 1 %}
<div class="text-center">
{% include 'pagination-custom' %}
</div>
{% endif %}
{% endpaginate %}
{% else %}

{% comment %}
If search.performed is false, someone either accessed the page without
the q parameter, or it was blank.
Be sure to show a search form here, along with anything else you want to showcase.
{% endcomment %}
<div class="searchpb">
<h5>{{ 'general.search.title' | t }}</h5>
{% include 'search-bar' %}
</div>
{% endif %}
{% else %}
{% include 'respond' %}
{% layout none %}
{% endunless %}
</div>

To modify the search functionality in the Maxdino theme to exclude blogs from the search results, you can follow these steps:

  1. From your Shopify admin, go to “Online Store” and select “Themes”.

  2. Locate and click on the “Actions” dropdown for the Maxdino theme, then choose “Edit code”.

  3. In the left-hand sidebar, under “Sections”, click on “search.liquid” to open the search template file.

{% for result in search.results %}
  {% if result.object_type != 'blog' %}
    ...
  {% endif %}
{% endfor %}

Hello unfortunately the code you provided isn’t working for this template. I have shared the code above . However i think i answered my own question after exploring search and discovery app setting to remove blog and pages. All solved