Salesforce Commerce Cloud treats robots.txt as a developer task, tied to a specific instance of your site. That is a different mindset from platforms where you edit a text box and move on. Here, the file is one piece of a larger setup, and three other pieces can quietly undo your work if you miss them.

Platform screens change over time. If a menu name in this guide does not match what you see, check the vendor docs linked in Sources for the current path.

Pick one method, and respect the instance

There are two ways to serve the file, and they do not combine. Most teams type a custom definition into Business Manager, which is the route Salesforce recommends. The other way is to place a robots.txt file in the cartridge static default folder of your storefront cartridge. Only one robots.txt can exist per cartridge, so choose one method and stay with it.

The definition also belongs to an instance type, not to your site in general. Staging and production should carry different rules. Staging should block every crawler, while production welcomes the AI crawlers that fetch answers. Salesforce guidance is to write the file on a staging instance first, then copy the site preferences over to production.

Two more gotchas can overrule a perfect definition. First, your hostname alias must be set up, or the file will not be served under your own domain at all. A correct definition paired with a missing alias simply returns a 404 at the robots.txt address. Second, Storefront Password Protection creates its own block-everything file that overrides your definition. While password protection is on, your custom file never takes effect, however carefully you wrote it.

This is not a theoretical corner of the platform, either. Salesforce documentation itself names GPTBot, ClaudeBot, and PerplexityBot as crawlers that request this file, so the platform expects AI bots to show up.

The steps

Start by checking the live file on each instance separately. Open yourdomain.com/robots.txt in a browser, using your real domain, once for staging and once for production. The two results should look different from each other.

Next, choose your method. For most teams, the custom definition in Business Manager is the right choice. Reserve the cartridge file for cases where the same file must be shared across several sites.

Now write the definition. Business Manager holds it under Merchant Tools, then SEO and Discoverability, then Robots. Pick the instance type first. On staging, a full block is the right content:

code
User-agent: *
Disallow: /

Production gets the complete file instead: your standard rules, with the AI crawler groups placed high, before any broad block rules:

code
User-agent: OAI-SearchBot
Allow: /

User-agent: ChatGPT-User
Allow: /

User-agent: Claude-SearchBot
Allow: /

User-agent: Claude-User
Allow: /

User-agent: PerplexityBot
Allow: /

User-agent: meta-webindexer
Allow: /

User-agent: bingbot
Allow: /

User-agent: *
Disallow: /account*
Disallow: /cart*
Disallow: /checkout*

One limit to know: ChatGPT-User only shows up when a person asks ChatGPT to look at a page. Your allow line gives it permission, but it cannot steer a fetcher that pays no attention to robots.txt.

Once staging looks right, copy its site preferences over to production. Writing straight onto production skips that check, and a staging file that blocks everything could go live by mistake.

Check the result on the production hostname, not only on staging. Still seeing the old file? Clear the static content cache, then reload the robots.txt address.

When the file is right and the site still blocks everything

Imagine a fashion business on this platform. The team writes the production definition in Business Manager, checks it on the staging hostname, and calls the job done. A scan of the production domain still reports a block-all file. The definition was never the problem. The site preferences were never copied from staging to production, and nobody had verified the hostname alias. Here, instance, copying, and alias all belong to the edit itself.

The file alone is not the whole story

Robots.txt states what you intend. It cannot force a result. If a bot manager or the Commerce Cloud edge stops an AI crawler before it reads the file, your allow rules never get a chance to matter. Checking that outer layer, and keeping an eye on it over time, sits outside this edit.

Frequently Asked Questions

Can I use both the Business Manager definition and a cartridge file?

No. Only one robots.txt can exist per cartridge, so pick one method and stay with it. For most teams the custom definition in Business Manager is the right choice.

Production still shows a block-all file after I wrote the definition. What went wrong?

Usually one of two things. Either the site preferences were never copied from staging to production, or the hostname alias was never set up. A correct definition with a missing alias returns a 404 at the robots.txt address.

Should staging and production carry the same rules?

No. Staging should block everything, and production should welcome the AI crawlers. Write on staging first, then copy the site preferences to production.

Does Storefront Password Protection change anything?

Yes. It creates a block-everything file of its own that overrides your definition. While it is on, your custom file never takes effect.

Verified Sources & Technical Documentation

links marked specific point to the page that supports the claim in this guide. Links marked general docs point to the vendor's general docs section for that topic, not to a page that proves every step. Check the vendor docs for the current path before relying on a menu name or click path in this guide.