how to edit shopify robots.txt file

How to Edit Shopify Robots.txt File, Updated 4th January 2021 – In this article I am going to explain what the Shopify robots.txt file is, where in your online store is located and how to hide a page from search engines.

If you want to learn the basics of SEO for Shopify, make sure you check my other articles:

If you need help with ranking your website on Google, feel free to check our Shopify SEO services.

What is the Robots.txt File?

The robots.txt file is where you give instructions to Google and other search engine crawler about what pages to crawl and what not.

For example, it’s typical for a robots.txt file to instruct crawlers not to crawl internal admin or login pages.

Where is the Shopify Robots.txt File Located?

The Shopify robots.txt file is located in the root folder of your primary domain.

How Do I Edit the Shopify Robots.txt File?

You can’t edit your Shopify robots.txt file directly but you can instruct Google spiders about not crawling one or more page:

  • 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.

How to Hide Shopify Search Template from Google

To hide the search template from Google:

  • 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:
{% if template contains 'search' %}
<meta name="robots" content="noindex">
{% endif %}

How to Hide a Specific Page from Google

To hide a specific page from Google:

  • 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:
{% if handle contains 'page-handle-you-want-to-exclude' %}
<meta name="robots" content="noindex">
{% endif %}

Make sure that you replace page-handle-you-want-to-exclude with the correct page handle.

  • Click Save.

How to Hide Multiple Pages from Google

To hide multiple pages from Google:

  • 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:
{% if handle contains 'page-handle-you-want-to-exclude' %}
<meta name="robots" content="noindex">

{% elsif handle contains 'your-page-handle-2' %}
<meta name="robots" content="noindex">

 {% elsif handle contains 'your-page-handle-3' %} <meta name="robots" content="noindex">

 {% else %} {% endif %}

Make sure that you replace page-handle-you-want-to-exclude with the correct page handle.

  • Click Save.

Sources

https://help.shopify.com/en/manual/promoting-marketing/seo/hide-a-page-from-search-engines
https://www.rmehdee.com/blogs/life-experiences-and-hacks/hiding-multiple-shopify-pages-from-search-engines

Was this article helpful?

close
Oval@3x 2

Don’t miss our weekly posts!

We don’t spam! Read our privacy policy for more info.

Related Post

6 Comments

Leave a Comment

Recent Posts

instagram live rooms
digital marketing weekly roundup
google search console association
markus spiske Skf7HxARcoc unsplash 1
digital marketing weekly roundup