You can edit your Shopify store’s robots.txt file as of 2026.
Shopify generates robots.txt automatically with useful default rules already in place.
You may want to change those defaults for several reasons:
- Stop particular bots from crawling the whole site, including AI bots like ChatGPT.
- Keep bots from crawling particular pages or sections.
- Give specific bots permission to access part or all of the site, such as explicitly allowing Googlebot.
- Let bots crawl more slowly with a “Crawl-delay” so they do not overload the site.
A page can still appear in Google even when you prevent a bot from crawling it. To hide it completely, add a “noindex” tag too.
(The noindex explanation and an easy way to add the tag are below.)
Start with how crawling works.
(For the robots.txt editing steps without that explanation, click here.)
What is a robots.txt File?
A robots.txt file is a text file that tells search engines which pages to crawl or avoid, and how often to crawl them. This helps manage search engine traffic and prevents certain pages from being indexed. However, blocking a bot from crawling doesn’t guarantee the page won’t appear in search results. To hide pages completely, you also need to add a “noindex” tag.

Robots known as “crawlers” help search engines such as Google discover pages in a Shopify store.
Search engines need to crawl the store to rank it. A page they cannot find cannot rank in Google or other search engines.
The robots.txt file, also called the “robots exclusion standard”, tells crawlers which store pages they can request.
A robots.txt file does not hide a page from Google searches.
Its main purpose is to prevent excessive requests from overloading the site. Keeping pages out of Google and other search engines requires a different method.
A crawler can follow a direct link from another website and discover your page that way.
In that situation, it can rank the page in Google without reading robots.txt.
Add a noindex tag to the page to hide it from Google.
(Password protection also works, but visitors browsing the site would then be unable to open that page.)
A noindex tag tells crawlers not to crawl the page. This code looks like:
<meta name="robots" content="noindex" />Adding this to a Shopify page or product hides it from search engines, including Google, Bing and Yahoo.
To hide a page from a search engine or AI bot, use both methods: list the page or category in robots.txt and add a noindex tag to it.
Follow the editing steps below to do this.
How To Edit Your Shopify robots.txt File
- From your Shopify admin, click Settings > Apps and sales channels
- From the Apps and sales channels page, click Online store
- Click Open sales channel
- Click Themes
- Click the … button, and then click Edit Code
- Click Add a new template, and then select robots
- Click Create template
- Make the changes that you want to make to the default template.
- Save changes to the robots.txt.liquid file in your published theme
Access the robots.txt.liquid Template
Sign in to Shopify admin, then follow these steps:
- Open Settings > Apps and sales channels.
- Select Online store and then Open sales channel.
- Choose Themes.
- Open the … menu and choose Edit Code.
- In Templates, choose Add a new template, then select robots.
- Select Create template.
Add or Remove Directives Using Liquid Code
Edit robots.txt.liquid with Liquid code so Shopify can still update the file automatically later. Adding or removing directives changes how bots and search engines interact with the site, helping SEO and performance.
Use the code below to stop all crawlers accessing certain pages, such as URLs containing ?search=:
{% for group in robots.default_groups %}
{{- group.user_agent }}
{%- for rule in group.rules -%}
{{ rule }}
{%- endfor -%}
{%- if group.user_agent.value == '*' -%}
{{ 'Disallow: /*?search=*' }}
{%- endif -%}
{%- if group.sitemap != blank -%}
{{ group.sitemap }}
{%- endif -%}
{% endfor %}
This rule can keep filtered-content pages out of search results, avoiding duplicate content that dilutes your SEO work.
Remove Default Rules
The code below removes a default rule. For example, you may want crawlers to access /terms/ so users can find it through search engines:
{% for group in robots.default_groups %}
{{- group.user_agent }}
{%- for rule in group.rules -%}
{%- unless rule.directive == 'Disallow' and rule.value == '/terms/' -%}
{{ rule }}
{%- endunless -%}
{%- endfor -%}
{%- if group.sitemap != blank -%}
{{ group.sitemap }}
{%- endif -%}
{% endfor %}Removing the rule makes legal pages such as terms and conditions accessible to users and indexed by search engines.
Add Custom Rules
Add the following to block a particular crawler, such as Antropic’s AI bot:
User-agent: anthropic-ai
Disallow: /To give a crawler permission, allow it with the code below. OpenAI’s ChatGPT crawler bots are an example:
User-agent: GPTBot
Allow: /Blocking chosen crawlers can reduce server load and help protect sensitive content by stopping those bots from accessing the site.
Include Extra Sitemap URLs
Add a line to robots.txt for any additional sitemap you want to include.
Use the following for the extra sitemap URL:
Sitemap: [sitemap-url]For instance, replace [sitemap-url] with https://yourwebsite.com/sitemap2.xml.
Save and Test Changes
Save robots.txt.liquid after editing, then check the changes in Google’s robots.txt Tester. Verify that the custom rules work and contain no errors.
Delete robots.txt.liquid Customizations
Delete the robots.txt.liquid template to return to the default robots.txt. Save a copy of the custom rules first in case you need them again.
Handling Theme Updates
A theme uploaded through Themes does not import robots.txt.liquid. Preserve those changes with ThemeKit or command line changes.
Consult Shopify Partner or Expert
If you are uncertain about editing the file, a Shopify Partner can implement the changes correctly and help avoid problems.
Shopify Indexed Page Blocked by robots.txt
Search engines may index a page that robots.txt blocks if your own site or another website links directly to it.
A robots.txt rule stops crawlers accessing the page, but links from elsewhere can still let search engines index it. Unwanted pages may therefore appear in results.
Use a noindex tag with robots.txt directives to prevent indexing. Follow How to Hide Shopify Pages From Search Engines below for the steps.
How To Hide Shopify Pages From Search Engines
- Locate the theme.liquid file
- Identify the page handle of the page you want to hide
- Add in the code snippet
1. Locate The theme.liquid File
Find theme.liquid using the steps below. Every online store theme has this file.
- Sign in and open Shopify admin.
- Open Online Store.
- Select Themes.
- Find the theme used by your Shopify store.
- Choose Actions > Edit code.
- Open theme.liquid in the Layout folder.


2. Identify The Page Handle Of The Page You Want To Hide
A page handle identifies a page within its URL. A product page named Amazing Tennis Balls would usually have the handle ‘amazing-tennis-balls’.
3. Add In The Code Snippet
Insert a code snippet below <head> in the theme.liquid layout file.
For the Amazing Tennis Balls product pages, paste this code to hide them:
{% if handle contains 'amazing-tennis-ball' %}
<meta name="robots" content="noindex">
{% endif %}For another page, replace ‘amazing-tennis-ball’ with its handle. The code hides a page whose URL contains that handle from Google, Bing and Yahoo.
Save the configuration with the Save button.
How to Hide Multiple Pages From Search Engines
There is no simple way to group all the pages you want to stop Google and Bing crawling. Work through the following steps.
- List every page to exclude from indexing by Google, Yahoo, Bing and other search engines.
- Turn those page names into page handles.
- Edit the code below and place it in the head section to prevent indexing. Use the correct handles in place of ‘page-handle-you-want-to-exclude’ and ‘another-page-handle-you-want-to-exclude’.
{% if handle contains 'page-handle-you-want-to-exclude' %}
<meta name="robots" content="noindex">
{% elsif handle contains 'another-page-handle-you-want-to-exclude' %}
<meta name="robots" content="noindex">
{% else %}
<meta name="robots" content="index">
{% endif %}4. Select Save to prevent the pages appearing in search results.
This is a manual process: whenever you edit Shopify robots.txt for a new page, add {% elsif handle contains ‘new-page-handle’ %} in the <head> section.
That is straightforward for a small store, but maintaining it becomes difficult as the number of pages grows.
How to Hide the Search Template Page
Add a noindex tag to theme.liquid to keep the search template page out of Google and Bing results.
- Sign in and open your Shopify admin.
- Open Online Store.
- Select Themes.
- Find your Shopify store’s theme.
- Choose Actions > Edit code.
- Open the theme.liquid layout file under Layout.
- Place this code inside <head>.
{% if template contains 'search' %}
<meta name="robots" content="noindex">
{% endif %}8. Select Save to stop search engines such as Google including the search template page in search engine results pages (SERPs).
Conclusion
Editing robots.txt.liquid gives you more control over how bots access Shopify pages. Customising these rules makes managing SEO easier and helps control search visibility and performance.
Combine noindex tags with robots.txt to exclude pages fully from search engines such as Google. Visitors can still navigate the website while those pages remain unindexed.
Use robots.txt and noindex tags where needed to control how search engines interact with the store. Correct indexing helps the store’s SEO and the experience for visitors.

