Skip to content

fix(seo): disallow status and unsubscribe token routes in robots.txt - #73

Merged
royalpinto007 merged 3 commits into
AgentPostmortem:mainfrom
waterlemonnn:fix/robots-token-routes
Aug 7, 2026
Merged

fix(seo): disallow status and unsubscribe token routes in robots.txt#73
royalpinto007 merged 3 commits into
AgentPostmortem:mainfrom
waterlemonnn:fix/robots-token-routes

Conversation

@waterlemonnn

Copy link
Copy Markdown
Contributor

Closes #57.

`/status/[token]` and `/unsubscribe/[token]` put a private token in the path and are linked from outbound email, same as `/edit/[token]` — so they should be kept out of `robots.txt` too. Added both to the disallow list, and made `/admin` a trailing-slash path like the others for consistency.

Checked `/status/[token]` and `/unsubscribe/[token]` route metadata — both already set `robots: { index: false }`, so no change needed there.

Verified locally: `npx prettier --check .`, `npm run lint`, `npx tsc --noEmit` all pass, and `curl localhost:3000/robots.txt` shows the new entries:

```
User-Agent: *
Allow: /
Disallow: /admin/
Disallow: /api/
Disallow: /edit/
Disallow: /status/
Disallow: /unsubscribe/
```

`npm run build` fails in my environment due to a missing `RESEND_API_KEY` — confirmed this is pre-existing and unrelated by reproducing it on a clean checkout of `main`.

waterlemonnn and others added 3 commits August 8, 2026 00:48
Both /status/[token] and /unsubscribe/[token] carry a private token in
the URL and are linked from outbound email, same as /edit/[token]. Add
them to the disallow list and normalize /admin to have a trailing slash
like the rest.

Fixes AgentPostmortem#57
robots.txt matches on prefix. "/admin/" only covers paths under it, so
app/admin/page.tsx, the dashboard itself, would have become crawlable.
"/admin" covers both it and everything beneath.

The other four are right as they are: /api, /edit, /status and
/unsubscribe have no bare page, only tokenised children.
@royalpinto007

Copy link
Copy Markdown
Contributor

Good catch on the token routes, thanks. Merged with one adjustment pushed to this branch.

The change from /admin to /admin/ would have had the opposite effect to the one intended. robots.txt matches on prefix, so /admin covers both the dashboard page and everything under it, while /admin/ only covers the children. app/admin/page.tsx exists, so the trailing slash would have quietly made the dashboard itself crawlable.

Reverted that one entry to /admin. The other four are right as you had them: /api, /edit, /status and /unsubscribe have no bare page, only tokenised children, so the slash is correct there.

The /status/ and /unsubscribe/ additions are the valuable part of this, since those URLs carry tokens that should never end up in an index.

@royalpinto007
royalpinto007 merged commit 3fa129f into AgentPostmortem:main Aug 7, 2026
5 checks passed
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Merged, @waterlemonnn. Thank you for taking the time.

Genuinely helpful change for agentpostmortem.

If this project helps you out, a star helps others find it too.

Happy to see more from you whenever you have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

robots.txt does not disallow the token URLs /status/ and /unsubscribe/

2 participants