<!-- wp:heading -->
<h2>Editing robots.txt.liquid</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Search engines, such as Google, constantly crawl the internet in search of new data as a source for their search results. The&nbsp;<code>robots.txt</code>&nbsp;file tells search engine bots, known as crawlers, which pages to request to view from your online store. All Shopify stores have a default&nbsp;<code>robots.txt</code>&nbsp;file that's optimal for Search Engine Optimization (SEO).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Your sitemap is used by search engines to place your online store in the search engine results.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>On this page</h2>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>Overview</li><li>Edit robots.txt.liquid</li><li>Delete robots.txt.liquid customizations</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 id="overview">Overview</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The default&nbsp;<code>robots.txt</code>&nbsp;file works for most stores, but you can edit the file through the&nbsp;<a href="https://shopify.dev/themes/architecture/templates/robots-txt-liquid">robots.txt.liquid theme template</a>. You can make the following edits:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>allow or disallow certain URLs from being crawled</li><li>add crawl-delay rules for certain crawlers</li><li>add extra sitemap URLs</li><li>block certain crawlers</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>The&nbsp;<code>robots.txt</code>&nbsp;file is located at the root directory of your Shopify store's&nbsp;primary domain name. For example:&nbsp;<code>www.mojoin.com/robots.txt</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><p><strong>Caution</strong></p><cite>This is an&nbsp;unsupported customization. Shopify Support can't help with edits to the&nbsp;<code>robots.txt.liquid</code>&nbsp;file. If you need to edit your&nbsp;<code>robots.txt.liquid</code>&nbsp;file, then you can&nbsp;hire a Shopify expert&nbsp;to edit the code for you. Incorrect use of the feature can result in loss of all traffic.</cite></blockquote>
<!-- /wp:quote -->

<!-- wp:heading -->
<h2 id="edit-robots-txt-liquid">Edit robots.txt.liquid</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>If you want to edit the&nbsp;<code>robots.txt.liquid</code>&nbsp;file, then you should work with a Shopify Expert or have expertise in code edits and SEO.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You can use Liquid to add or remove directives from the <code>robots.txt.liquid</code> template. This method preserves Shopify’s ability to keep the file updated automatically in the future, and is recommended.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Remove any previous customizations or workarounds, such as using a third-party service such as Cloudflare, before you edit the&nbsp;<code>robots.txt.liquid</code>&nbsp;file.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 id="steps">Steps:</h4>
<!-- /wp:heading -->

<!-- wp:list {"ordered":true} -->
<ol><li>From your Shopify admin, go to&nbsp;<strong>Online Store</strong>&nbsp;&gt;&nbsp;<strong>Themes</strong>.</li><li>Click&nbsp;<strong>Actions</strong>, and then click&nbsp;<strong>Edit Code</strong>.</li><li>Click&nbsp;<strong>Add a new template</strong>, and then select&nbsp;<strong>robots</strong>.</li><li>Click&nbsp;<strong>Create template</strong>.</li><li>Make the changes that you want to make to the default template. For more information on liquid variables and common use cases, refer to Shopify's Developer page&nbsp;<a href="https://shopify.dev/themes/seo/robots-txt">Customize robots.txt.liquid</a>.</li><li>Save changes to the&nbsp;robots.txt.liquid&nbsp;file in your published theme.</li></ol>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Changes are instant, but crawlers don't always react immediately. You can test changes using&nbsp;<a href="https://support.google.com/webmasters/answer/6062598?hl=en">Google's robots.txt Tester</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You can also delete the contents of the template and replace it with plain text rules. This method is strongly not recommended, as rules may become out of date. If you choose this method, then Shopify can’t ensure that SEO best practices are applied to your robots.txt over time, or make changes to the file with future updates.</p>
<!-- /wp:paragraph -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><p><strong>NOTE</strong></p><cite>ThemeKit or command line changes will preserve the robots.txt.liquid file. Uploading a theme from within the Themes section of the Shopify admin will not import robots.txt.liquid.</cite></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<p><a href=""></a></p>
<!-- /wp:paragraph -->