Hiding a page from search engines

You can hide pages that are not included in your robots.txt.liquid file by customizing the <head> section of your store’s theme.liquid layout file. You need to include some code to noindex particular pages.

  • From your Shopify admin, go to Online Store > Themes.
  • Find the theme you want to edit, and then click Actions > Edit code.
  • Click the theme.liquid layout file.
  • paste the following code in the <head> section:

Hiding ‘All Collection’ page

1
2
3
{% if template == 'list-collections' %}
<meta name="robots" content="noindex">
{% endif %}

Hiding ‘Search’ page

1
2
3
{% if template contains 'search' %}
<meta name="robots" content="noindex">
{% endif %}

Hiding a specific page by handle

1
2
3
{% if page.handle contains 'page-handle-you-want-to-exclude' %}
<meta name="robots" content="noindex">
{% endif %}