How to Edit robots.txt in Shopify (robots.txt.liquid) Without Breaking It
You change one line in Shopify robots.txt, refresh /robots.txt, and suddenly you’re wondering what else you just blocked. That’s the real risk with robots.txt.liquid: it’s easy to make a storewide crawl mistake fast.
Robots.txt is a crawl control file, not a guaranteed “keep this out of Google” switch. A URL can still get indexed if search engines discover it elsewhere, even when crawling is blocked. On Shopify, that crawling vs indexing difference matters because a small edit can change what bots spend time fetching across your store.
The good news is Shopify gives you a supported way to customise robots.txt. Shopify generates robots.txt automatically, and the safe workflow is to create a robots.txt.liquid template in your theme and keep Shopify’s default rules intact while you make a narrow, intentional change. This guide walks you through that process using Shopify’s documented approach, then shows you how to confirm what your store actually serves at /robots.txt so you don’t ship an accidental crawl block.
Where Is Shopify Robots.txt, and Can You Edit It?
Before you change shopify robots.txt, you need to know where it actually comes from. Shopify generates robots.txt automatically for every online store. You can view what Shopify serves by opening /robots.txt on your domain in a browser. That file is the source of truth for Googlebot and other crawlers, regardless of what you expected to publish.
That default robots.txt is not a theme file you can open and edit directly. Shopify builds it server-side. If you try to “edit robots.txt Shopify” by uploading a random text file, or by hardcoding rules somewhere else, Shopify will keep serving its generated version.
The Supported Way to Customize robots.txt: robots.txt.liquid
Shopify supports customization through your theme by adding a template named robots.txt.liquid. When that template exists, Shopify uses it to render robots.txt, using Liquid plus Shopify’s documented robots.txt objects and tags.
Two rules keep you out of trouble:
- Start from Shopify’s defaults, then change as little as possible. Removing default directives can block important URLs from being crawled.
- Use only Shopify’s documented approach for adding, removing, or modifying groups and rules. robots.txt is picky, and a small syntax mistake can change how crawlers interpret the file.
Shopify documents the feature and the Liquid structure here: Shopify.dev: robots.txt and robots.txt.liquid. Shopify also explains the high-level behavior and what merchants can customize in its Help Center documentation: Shopify Help Center: Editing robots.txt.
If your goal is a safe change, treat robots.txt.liquid like a controlled override: keep the generated baseline, then add a narrow rule for a specific crawler or path you understand.
How to Edit Robots.txt in Shopify Using robots.txt.liquid (Step-by-Step)
To edit robots.txt Shopify safely, you do not edit a file on the server. You create a robots.txt.liquid template in your theme, then let Shopify generate robots.txt from that template. Shopify documents this workflow and the Liquid objects you can use to keep the default rules intact. Start with Shopify’s official docs so you copy the supported pattern exactly: Shopify.dev: robots.txt and robots.txt.liquid.
- Back up before you touch anything. Duplicate your live theme in Shopify admin. Work in the duplicate first so you can revert fast if a rule blocks crawling.
- Create the template file. In the duplicate theme’s code editor, add a new template named robots.txt.liquid. (Shopify’s docs show the exact location and naming requirements.)
- Start from Shopify’s default output. In robots.txt.liquid, use the documented Liquid output that prints Shopify’s generated groups, then add your smallest change underneath. Do not rewrite the whole file by hand. Shopify’s doc explains how to output the default rules and where customizations belong.
- Make one change at a time. Add or remove rules using the Liquid objects and tags Shopify supports for robots.txt customization. Avoid “creative” syntax. If you need an example, copy the exact patterns from Shopify’s documentation, not from random blog posts.
- Publish the theme change intentionally. Preview first, then publish the updated theme when you are confident the template renders correctly.
Use Only Shopify-Documented Liquid Objects
Robots.txt is strict: one bad directive can block important paths. Shopify’s robots.txt.liquid system exists so you can modify the generated groups safely, using the objects Shopify exposes. Follow the objects and examples in Shopify.dev, and keep your edits narrow: a specific user-agent group, a specific path, and a specific intent.
After you publish, fetch /robots.txt in a browser and confirm your change appears exactly once, in the place you expected. You will validate it more thoroughly in the verification section.
What Changes Are Actually Safe? A Practical “Least-Change” Checklist
If you can see your change when you open /robots.txt, the next question is whether it was a safe change. With edit robots.txt Shopify work, “safe” usually means: you kept Shopify’s generated baseline and you made one narrow adjustment that fixes a specific crawl problem.
Use this least-change checklist before you touch robots.txt.liquid. If you cannot answer “why do I need this rule?”, do not ship it.
Least-Change Checklist for Shopify robots.txt
- Start with a single target: one path, one crawler, or one behavior you want. “Reduce crawling of internal search URLs” is a target. “Improve SEO” is not.
- Prefer narrower paths: block a specific pattern or directory instead of large sections of the site. Broad blocks are how product and collection pages disappear from crawling.
- Keep Shopify defaults intact: treat removals as high risk. When you remove a default directive, you also remove the safety assumptions Shopify built in.
- Only change what you can test: if you cannot verify it by fetching /robots.txt and checking a few example URLs, skip it for now.
Changes that are usually low risk share one trait: they reduce waste without touching core commerce URLs. For example, blocking obvious low-value duplicates (such as certain parameter-based URLs) can be reasonable when you have confirmed they create crawl noise in Google Search Console. Keep the scope tight and reversible.
Avoid changes that can break crawling storewide:
- Do not block “/” for any user-agent unless you want the entire storefront uncrawled.
- Do not block assets blindly (theme files, scripts, images). Search engines may need them to render pages.
- Do not use robots.txt to “deindex” pages. robots.txt controls crawling, not indexing. Use Shopify’s SEO settings, canonical tags, or noindex where appropriate.
When you need to add or remove rules, use Shopify’s documented robots.txt Liquid objects and tags exactly as described in Shopify.dev. If your idea requires undocumented syntax or hacks, that’s a sign to stop and reconsider.
How to Check Your Work After Editing Shopify Robots.txt
When you edit robots.txt Shopify via robots.txt.liquid, verification is the difference between a controlled tweak and an accidental crawl block. Your theme code is not the source of truth. What Shopify serves at /robots.txt is what Googlebot and other crawlers read.
- Open the live file. Visit https://yourdomain.com/robots.txt in an incognito/private window. Confirm your new directive appears exactly where you expected.
- Sanity-check the basics. Look for obvious breakage: missing sections you expected Shopify to output, duplicated groups, or a broad Disallow: / in a group that applies to normal crawlers.
- Confirm the sitemap line. Shopify typically includes a sitemap reference. If you intended to keep Shopify defaults, this line should still be present in the rendered output.
- Test URLs you care about. Pick a product URL, a collection URL, and any path you touched (for example a filter or search pattern). Read the matching user-agent group and confirm the allow/disallow logic matches your intent.
After the manual review, run an automated check. Use Balzac’s free robots.txt and sitemap checker to validate that your shopify robots.txt renders cleanly and that the sitemap reference resolves the way you expect.
If you changed rules because of AI-related crawlers, validate that behavior explicitly. Run Balzac’s AI crawler checker and confirm the user-agents you care about see the right directives.
If you are still planning changes (or you want to sketch a least-change version before editing theme code), use Balzac’s robots.txt generator to draft rule ideas, then translate only the final decisions into Shopify’s documented robots.txt.liquid approach.
Remember what you are testing: robots.txt controls crawling, not indexing. If something must stay out of search results, use noindex on the page (where Shopify allows it) or remove the page entirely, rather than relying on robots.txt.
Troubleshooting: Why Your Shopify Robots.txt Changes Aren’t Showing Up
If you edited robots.txt.liquid and your shopify robots.txt at /robots.txt still looks unchanged, assume Shopify is serving a different file than the one you edited. Start by checking the live output first, then work backward to the theme and the Liquid syntax.
Use this quick checklist to find the cause:
- You did not create the right file name. Shopify looks for robots.txt.liquid exactly. A typo, different extension, or wrong template type means Shopify keeps serving the auto-generated robots.txt.
- You edited the wrong theme. Many stores have a published theme and one or more draft themes. If you added robots.txt.liquid to a draft theme, /robots.txt will not change until you publish that theme.
- Your robots.txt.liquid does not output Shopify’s defaults. If you replaced the file content with hand-written rules, you can accidentally drop the generated baseline. Shopify’s supported approach is to render the default groups and then apply modifications using Shopify’s documented objects and tags. Re-check the structure against Shopify.dev: robots.txt and robots.txt.liquid.
- Your edit uses unsupported syntax. robots.txt is strict, and Shopify’s customization layer is stricter. If you tried to “edit robots.txt Shopify” with custom Liquid logic outside what Shopify documents, Shopify may render something you did not expect, or your change may end up in the wrong group.
- You are seeing a cached version. Browsers, CDNs, and SEO tools can show a cached version. Always hard-refresh, try an incognito window, and fetch /robots.txt with a different client (for example, curl) to confirm what Shopify serves.
How to Confirm What Shopify Is Actually Serving
Open https://yourdomain.com/robots.txt and verify two things: your custom line appears, and it appears in the correct user-agent group. If it does not, confirm which theme is published, confirm robots.txt.liquid exists in that theme, then compare your template against Shopify’s documentation and examples: Shopify Help Center: Editing robots.txt.
Conclusion: Keep Defaults, Make Small Edits, Then Verify
When you can open /robots.txt and see your directive in the correct group, you have done the hard part. The rest is discipline: keep Shopify’s generated baseline, change one thing, and confirm you did not accidentally change crawl access for core URLs.
If you remember one rule about shopify robots.txt, make it this: treat robots.txt.liquid as a controlled override, not a blank canvas. Shopify built defaults that assume normal storefront crawling, and you rarely improve SEO by deleting them.
A Safe Workflow for Editing robots.txt Shopify
- Write down the intent first. “Block internal search results” is an intent. “Improve rankings” is not.
- Duplicate your theme and work in the copy. Rollbacks should take minutes, not hours.
- Add robots.txt.liquid and output Shopify’s defaults. Use Shopify’s documented objects and structure so you keep the generated groups intact.
- Make the smallest edit that matches your intent. One user-agent, one path, one change.
- Verify the rendered output at /robots.txt. Trust what Shopify serves, not what your theme editor shows.
- Validate behavior with a checker. Confirm crawlers and sitemap references behave the way you expect.
When you feel tempted to “solve indexing” with robots.txt, stop. Robots.txt controls crawling, and search engines can still index blocked URLs if they discover them elsewhere. Use Shopify’s supported SEO controls for indexing decisions, and reserve robots.txt for crawl management.
If you need to confirm the supported approach or compare your template to official examples, use Shopify’s documentation: Shopify.dev: robots.txt and robots.txt.liquid and Shopify Help Center: Editing robots.txt.
One last operational note: Balzac does not publish directly to Shopify. If you use Balzac to generate SEO articles, copy and paste them into the Shopify blog, then keep your crawl rules tight so bots spend time on pages that can rank.