AboutAll ServicesFree EmailOur WorkGuidesFAQContact
ServicesSEO ServicesEcommerce RankingSpeed OptimizationWebsite AuditGoogle Ads ManagementMeta Ads ManagementSocial Media ManagementAnalytics & TrackingShopify Catalogue SEO
Build & SolutionsWordPress DevelopmentEcommerce DevelopmentCustom EcommerceFlying CartFlying AdsFlying Blog
Free ToolsAll free tools →
Domain and securityEmail Deliverability CheckWebsite Security GradeDNS CheckerWhois LookupDomain Expiry Checker
SEO and crawlingAI Crawler CheckerRedirect CheckerRobots.txt GeneratorSitemap CheckerSchema Markup Generator
Ads and trackingShopify Tracking CheckUTM BuilderBreak-even ROAS Calculator
Store and speedSpeed ReportShopify App Weight CheckMerchant Center Readiness CheckShopify Profit Margin and Fees CalculatorShopify Theme and App DetectorShopify Redirect CSV GeneratorBarcode Generator and GTIN CheckerImage to WebP Converter
Profiles and messagingWhatsApp Link & QR GeneratorLinkedIn Headline GeneratorUPI QR Code Generator
Dedicated SitesServices ↗Care ↗Firstlight ↗Truefeed ↗Woo2Shopify ↗Shopify ↗Realty Leads ↗AnkShakti ↗

Guide

How to write a robots.txt file

How do I write a robots.txt file?

5 min read

Short answer

A robots.txt file is a plain text file at yourstore.in/robots.txt. It starts with `User-agent: *`, then lists `Disallow:` lines for paths crawlers should skip, then a `Sitemap:` line. Use the free robots.txt generator on this site to build one for your platform and to choose which AI crawlers to block.

What the file does

I

t

i

s

a

p

o

l

i

t

e

r

e

q

u

e

s

t

,

n

o

t

a

l

o

c

k

.

B

e

f

o

r

e

a

c

r

a

w

l

e

r

r

e

a

d

s

y

o

u

r

p

a

g

e

s

i

t

a

s

k

s

r

o

b

o

t

s

.

t

x

t

w

h

a

t

i

t

m

a

y

v

i

s

i

t

.

S

e

a

r

c

h

e

n

g

i

n

e

s

a

n

d

t

h

e

b

i

g

A

I

c

o

m

p

a

n

i

e

s

f

o

l

l

o

w

i

t

.

A

b

a

d

b

o

t

c

a

n

i

g

n

o

r

e

i

t

,

a

n

d

t

h

e

f

i

l

e

i

s

p

u

b

l

i

c

,

s

o

n

e

v

e

r

l

i

s

t

a

p

r

i

v

a

t

e

a

d

d

r

e

s

s

i

n

i

t

.

The three parts you need

User-agent says who the rules are for. * means everyone. A named bot, such as GPTBot, means just that crawler.

Disallow lists paths to skip, such as /cart or /checkout. Allow makes an exception inside a blocked area, for example WordPress's /wp-admin/admin-ajax.php.

Sitemap points to your sitemap, so crawlers find every page you want found.

Try it now: Robots.txt Generator → · AI Crawler Checker →

What to block on a store

Pages with no search value: cart, checkout, account, internal search results, and filter and sort addresses that make endless near-copies of a collection.

Do not block your product, collection or blog pages, your images, or the CSS and scripts the pages need to display. Google reads those to understand the page.

Blocking AI crawlers

There are three kinds. Training crawlers (GPTBot, ClaudeBot, Google-Extended) collect pages to train models. Search crawlers (OAI-SearchBot, Claude-SearchBot, PerplexityBot) build the index behind AI search. Assistant crawlers (ChatGPT-User, Claude-User, Perplexity-User) open a page when a person asks about it.

Blocking training crawlers does not change your Google rankings. Blocking the search and assistant crawlers keeps you out of those answers. Decide per kind, not all or nothing.

The mistake that hides a whole site

Disallow: / under User-agent: * blocks every crawler from everything. It is meant for a site under construction, and it often survives a launch. Check yours: open yourstore.in/robots.txt and look for a lone slash.

Also remember robots.txt does not remove a page from Google. To keep a page out of search, use a noindex tag and leave the page crawlable so the tag can be read.

On Shopify, WordPress and WooCommerce

Shopify already writes a sensible default. You change it by adding a robots.txt.liquid file to your theme, and you add rules rather than replace the whole file.

WordPress and WooCommerce let you upload a file to the site root, or edit it from your SEO plugin.

How we can help

Want this done for you?

These are the services that fix what this guide describes. Prices are starting prices.

Not sure which you need? Book a free 30-minute call and bring this result, or send us a message. No obligation, no pitch deck.

Free robots.txt generator →Free AI crawler checker →301 vs 302 redirect →

Want free stats on your site first?

Send us the URL. We pull the numbers from your own accounts and tell you what is wrong before there is any quote, and before there is any contract.

No pitch deck, no obligation. Bring your URL and we will look at it together.