how to edit shopify robots.txt file

How to Edit Shopify Robots.txt File, Updated 11th August 2020 – In this article I am going to explain what the robots.txt file is, where in your Shopify 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.
  • To exclude the search template, paste the following code in the <head> section:
  • {% if template contains 'search' %}
    <meta name="robots" content="noindex">
    {% endif %}
  • To exclude a specific page, 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.



Related Post

Leave a Comment