As a Shopify store owner, you’re always looking for ways to improve your visibility on search engines like Google. While marketing and great products are key, technical SEO plays a vital role behind the scenes. One of the most powerful—and surprisingly simple—tools at your disposal is the robots.txt file.

Think of the robots.txt file as a gatekeeper for your website. It gives instructions to search engine crawlers (or “bots”) about which pages they should and shouldn’t access. By customizing this file, you can guide bots to your most important pages and prevent them from indexing low-value or duplicate content, ultimately boosting your store’s SEO.

In this guide, we’ll walk you through how to find, create, and edit your Shopify robots.txt file in three easy steps.

Step 1: Access Your Theme’s Code Editor

First, you need to get to the backend files of your Shopify theme. Don’t worry, you won’t be doing any complex coding.

  1. Log in to your Shopify dashboard.
  2. On the left-hand menu, find the Sales Channels section and click on Online Store.
  3. You’ll see your current theme. Next to the theme name, click on the three-dot button (…) to open a menu.
  4. From this menu, select Edit code.

[Image: A screenshot of the Shopify dashboard with the 'Online Store' and 'Edit code' options highlighted.]

Step 2: Find or Create the robots.txt File

You’ve now entered the theme code editor. On the left side of the screen, you’ll see a list of all the files and folders that make up your theme.

  1. Look for a folder named Templates. Click on it to expand its contents.
  2. Scroll through the files inside and look for one named robots.txt.liquid.
  3. If you find it, simply click on it to open the file for editing.
  4. If you don’t see it, no problem! Click the Add a new template button. In the pop-up window, select robots from the dropdown menu and click Create template. This will create a fresh robots.txt.liquid file for you.

[Image: A screenshot of the Shopify code editor, showing how to find the robots.txt.liquid file or use the 'Add a new template' button.]

Step 3: Add Your Code and Save

Now that your file is open, it’s time to add the instructions for the search engine bots. For most stores, a standard set of rules works perfectly.

  1. Copy the code block provided below. This code tells search engines to ignore pages like the cart, admin area, and internal search results, while ensuring they can still find your sitemap.

👇 CODE TO COPY 👇
Copy the code below and paste it into your robots.txt.liquid file as shown in the video.

{% comment %}
optimized for new theme
Reference: https://help.shopify.com/en/manual/pr…
{% endcomment %}

User-agent: *
Disallow: /a/downloads/-/*
Disallow: /admin
Disallow: /cart
Disallow: /carts
Disallow: /checkout
Disallow: /checkouts/
Disallow: /orders
Disallow: /account
Disallow: /collections/sort_by
Disallow: /collections/+
Disallow: /collections/%2B
Disallow: /collections/filter
Disallow: /blogs/+
Disallow: /blogs/%2B
Disallow: /search
Disallow: /policies/
Disallow: /preview_theme_id
Disallow: /preview_script_id
Disallow: /?oseid=*
Disallow: /?ls=*
Disallow: /.well-known/shopify/monorail
Disallow: /recommendations/products

Sitemap: https://yourdomain.com/sitemap.xml

User-agent: adsbot-google
Disallow: /checkout
Disallow: /checkouts/
Disallow: /orders
Disallow: /cart
Disallow: /?oseid=*
Disallow: /preview_theme_id
Disallow: /preview_script_id

User-agent: Nutch
Disallow: /

User-agent: AhrefsBot
Crawl-delay: 10

User-agent: AhrefsSiteAudit
Crawl-delay: 10

User-agent: MJ12bot
Crawl-delay: 10

User-agent: Pinterest
Crawl-delay: 1

All Done!

That’s it! You have successfully customized your robots.txt file. You’ve just taken a simple but powerful step toward better technical SEO for your Shopify store. This small change helps search engines understand your site better, which can lead to improved rankings and more organic traffic over time.