The `robots.txt.liquid` template renders the `robots.txt` file, which is hosted at the `/robots.txt` URL.

The `robots.txt` file tells search engines which pages can, or can't, be crawled on a site. It contains groups of rules for doing so, and each group has three main components:

- The user agent, which notes which crawler the group of rules applies to. For example, `adsbot-google`.
- The rules themselves, which note specific URLs that crawlers can, or can't, access.
- An optional sitemap URL.

Shopify generates a `robots.txt` file by default, which works for most shops, so this template isn't included in any themes by default.

> Tip:
> If you want to customize the `robots.txt.liquid` template, then refer to [Customize robots.txt](/docs/storefronts/themes/seo/robots-txt) for more information.

## Location

The `robots.txt.liquid` template is located in the `templates` directory of the theme:

```text
└── theme
    ├── layout
    ├── templates
    |   ...
    |   ├── robots.txt.liquid
    |   ...
    ...
```

If your theme doesn't already contain the `robots.txt.liquid` template, then you can add it with the following steps:


      <div class="section-tabs-container">
        <div role="tablist"
           aria-label="Desktop, iPhone, Android tabs"
           class="section-tabs">
      <button id="tabs-38088f-0"
              aria-selected="true"
              aria-disabled="false"
              aria-controls="content-38088f-0"
              class="desktop-item section-tabs__tab section-tabs__tab--is-selected"
              role="tab">
          Desktop
    </button><button id="tabs-38088f-1"
              aria-selected="false"
              aria-disabled="false"
              aria-controls="content-38088f-1"
              class="iphone-item section-tabs__tab "
              role="tab">
          iPhone
    </button><button id="tabs-38088f-2"
              aria-selected="false"
              aria-disabled="false"
              aria-controls="content-38088f-2"
              class="android-item section-tabs__tab "
              role="tab">
          Android
    </button>
    </div><div tabindex="0"
             role="tabpanel"
             id="content-38088f-0"
             aria-labelledby="tabs-38088f-0"
             class="desktop-item section-tabs__content--is-selected section-tabs__content">
        <ol>
<li><p>From your Shopify admin, go to <strong>Online Store</strong> &gt; <strong>Themes</strong>.</p></li>
<li><p>Find the theme that you want to edit, and then click <strong>...</strong> &gt; <strong>Edit code</strong>.</p></li>
</ol>

      </div><div tabindex="0"
             role="tabpanel"
             id="content-38088f-1"
             aria-labelledby="tabs-38088f-1"
             class="iphone-item  section-tabs__content">
        <ol>
<li><p>From the <a rel="external noreferrer noopener" target="_blank" href="https://www.shopify.com/install/detect">Shopify app</a>, tap <strong>Store</strong>.</p></li>
<li><p>In the <strong>Sales channels</strong> section, tap <strong>Online Store</strong>.</p></li>
<li><p>Tap <strong>Manage all themes</strong>.</p></li>
<li><p>Find the theme that you want to edit, and then tap <strong>...</strong> &gt; <strong>Edit code</strong>.</p></li>
</ol>

      </div><div tabindex="0"
             role="tabpanel"
             id="content-38088f-2"
             aria-labelledby="tabs-38088f-2"
             class="android-item  section-tabs__content">
        <ol>
<li><p>From the <a rel="external noreferrer noopener" target="_blank" href="https://www.shopify.com/install/detect">Shopify app</a>, tap <strong>Store</strong>.</p></li>
<li><p>In the <strong>Sales channels</strong> section, tap <strong>Online Store</strong>.</p></li>
<li><p>Tap <strong>Manage all themes</strong>.</p></li>
<li><p>Find the theme that you want to edit, and then tap <strong>...</strong> &gt; <strong>Edit code</strong>.</p></li>
</ol>

      </div>
      </div>
    


1. In the left sidebar, under the **Templates** heading, click **Add a new template**.
2. In the **Create a new template for** drop-down menu, select **robots.txt**.
3. Click **Create template**.

## Content

This template can't be a [JSON template](/docs/storefronts/themes/architecture/templates/json-templates). It must be `robots.txt.liquid`.

The rules included in the default `robots.txt` file are mirrored through the Liquid [`robots` object](/docs/api/liquid/objects/robots), which the `robots.txt.liquid` template uses to output the rules.

For example:

<p>
<div class="react-code-block" data-preset="file">
<div class="react-code-block-preload ThemeMode-dim">
<div class="react-code-block-preload-bar "></div>
<div class="react-code-block-preload-placeholder-container">
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>
<div class="react-code-block-preload-code-container">
<div class="react-code-block-preload-codeline-number"></div>
<div class="react-code-block-preload-codeline"></div>
</div>

</div>
</div>

<script data-option="filename" data-value="templates/robots.txt.liquid"></script>

<script type="text/plain" data-language="liquid">
RAW_MD_CONTENT
{% for group in robots.default_groups %}
  {{- group.user_agent -}}

  {% for rule in group.rules %}
    {{- rule -}}
  {% endfor %}

  {%- if group.sitemap != blank -%}
    {{ group.sitemap }}
  {%- endif -%}
{% endfor %}

END_RAW_MD_CONTENT</script>

</div>
</p>


While you can replace all the template content with plain text rules, it's strongly recommended to use the provided Liquid objects whenever possible. The default rules are updated regularly to ensure that SEO best practices are always applied.

## Usage


If you want to customize the `robots.txt.liquid` template, then you need to add it with the following steps:


1. In the code editor for the theme you want to edit, open the **Templates** folder.
2. Click **Add a new template**.
3. Select `robots.txt` under the **Create a new template for** drop-down menu.
4. Click **Create template**.


To learn about customizing this template, refer to [Customize robots.txt](/docs/storefronts/themes/seo/robots-txt).