robots.txt

Before a search engine or any other well-behaved crawler fetches a page, it reads /robots.txt to learn what it may fetch. Your PocketOne app has one already. Open https://<your app>/robots.txt:

User-agent: *
Content-Signal: search=yes, ai-input=yes, ai-train=no
Disallow: /_/
Disallow: /mcp

Sitemap: https://notes.example.com/sitemap.xml

The dashboard (/_/) and the MCP endpoint are closed; everything else is open. The Sitemap line points crawlers at your sitemap, and appears when there's a page to list.

The Content-Signal line tells crawlers what they may do with your pages: put them in a search index (search), use them to answer someone's question with AI (ai-input), and train AI models on them (ai-train). Out of the box the first two are yes and training is no. See Content signals to change them.

It's a request, not a lock. Anyone can read robots.txt, and only polite crawlers follow it. To keep data private, use API rules.

Where the settings are

Open your app's dashboard at https://<your app>/_/, click Settings, then Extensions in the sidebar. The robots.txt section on that page holds every setting below. Change what you need and click Save.

Mark a path private and it's kept out of search everywhere at once: a Disallow line in robots.txt, left out of the sitemap and llms.txt, and every page under it sent with a noindex header, so it stays out of search results even when someone links to it.

Three ways, use any:

  • In the dashboard's robots.txt settings, Private paths, one per line:

    /account
    /admin/
    
  • In Pages, in pb_pages/+config.js:

    module.exports = { private: ['/account', '/admin/'] }
    
  • In any pb_hooks file:

    $robotsTxt.private('/account')
    

A prefix covers whole path segments: /account covers /account and /account/settings, not /accounts.

On a staging or preview copy of your app, turn on Keep this app out of search results in the robots.txt settings. Every response then says noindex, robots.txt says search=no and the sitemap is empty. Apps started with --dev always do this.

robots.txt itself stays open on purpose: a crawler has to fetch a page to see its noindex, and that's how pages it already found leave search results.

AI training crawlers

They can fetch your pages by default, like any other crawler, and the Content-Signal line asks them not to train on them (ai-train=no). Not every crawler reads that line. To close your app to crawlers that collect pages to train AI models (GPTBot, ClaudeBot, Google-Extended, Applebot-Extended, CCBot, Bytespider, meta-externalagent), turn on Block AI training crawlers in the robots.txt settings. Assistants that fetch a page because someone asked about it are still let in.

Content signals

In the dashboard's robots.txt settings, tick or untick search, ai-input and ai-train (ticked is yes), and list the crawlers the line is for under Content signals: user agents, one per line (* is every crawler).

You can also set them in pocketone.yaml; any key you leave out keeps its default:

robots-txt:
  content_signal:
    ai_train: true

When a signal is set in both places, the value saved in the dashboard is used. The form opens with the values from pocketone.yaml (or the defaults). Change a field and save, and that field uses your value from then on; a field you didn't change keeps following pocketone.yaml.

Two switches override both: while the app is kept out of search, search is no, and while AI training crawlers are blocked, ai-train is no, whatever the dashboard or the file says.

Add rules from your code

// pb_hooks/robots.pb.js
$robotsTxt.add({ disallow: '/search' })
$robotsTxt.add({ userAgent: 'Bingbot', allow: '/api/files/' })
$robotsTxt.add({ sitemap: '/feeds/sitemap.xml' })

Each call adds one line: disallow or allow a path prefix, or another sitemap. userAgent picks the crawler (default: every crawler). The dashboard's Extra disallow field does the same as disallow without code.

Write the whole file yourself

Put a robots.txt in pb_public (or pb_pages) and it answers instead of the generated one. Private paths and the staging switch still apply to the noindex header, the sitemap and llms.txt.

Turn it off

In pocketone.yaml:

robots-txt:
  enabled: false

/robots.txt then answers 404 unless you have a file of your own, and nothing sends noindex.

Reference