Skip to content

Commit b321c36

Browse files
committed
Add note: Disallow AI bots in robots.txt
Fixes #975
1 parent bd4554d commit b321c36

6 files changed

Lines changed: 44 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@eslint/compat": "^1.3.1",
1919
"@eslint/js": "^9.32.0",
2020
"@iconify/svelte": "^5.0.1",
21-
"@lucide/svelte": "^0.527.0",
21+
"@lucide/svelte": "^0.528.0",
2222
"@maiertech/sveltekit-helpers": "^0.28.0",
2323
"@playwright/test": "^1.54.1",
2424
"@sindresorhus/slugify": "^2.2.1",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/api/notes/2025/+server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import noteAmIStillRelevantAsADeveloper from '$notes/(2025)/am-i-still-relevant-as-a-developer/meta';
2+
import noteDisallowingAiBotsInRobotsTxt from '$notes/(2025)/disallowing-ai-bots-in-robots-txt/meta';
23
import noteEnvVarsInCode from '$notes/(2025)/env-vars-in-vscode/meta';
34
import noteHostingInEurope from '$notes/(2025)/hosting-in-europe-beyond-big-tech/meta';
45
import noteHowToWriteExceptionalDocs from '$notes/(2025)/how-to-write-exceptional-docs/meta';
@@ -14,6 +15,7 @@ export const prerender = true;
1415
export const GET: RequestHandler = async () => {
1516
// Sort order: latest first.
1617
return json([
18+
noteDisallowingAiBotsInRobotsTxt,
1719
notePenpotsMissingSvgTextToPathFeature,
1820
notePrerenderingServerRoutes,
1921
noteHostingInEurope,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { resolveNote } from '$lib/server/resolvers';
2+
import type { PageServerLoad } from './$types';
3+
import meta from './meta';
4+
5+
export const load: PageServerLoad = async () => {
6+
const note = await resolveNote(meta);
7+
const { title, description, ogImageUrl } = note;
8+
return {
9+
note,
10+
seo: { title, description, ogImageUrl }
11+
};
12+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
If you have not checked the HTTP logs of your website lately, I recommend doing so. I was stunned to
2+
see big-name AI bots crawling my website daily, hunting for new training data.
3+
4+
Even though my personal website is a non-commercial side project, I do not like the idea of my
5+
content being dissolved into some AI overview with zero credit. I am trying to give you an
6+
incentive, useful content, to come back to my website regularly, either directly, via my RSS feeds,
7+
or via my socials. Even though your clicks do not make me money, they do motivate me to post more.
8+
9+
That is why I have updated my `robots.txt` to disallow the bots from the link above and a few more I
10+
found in my logs. I have also explicitly allowed a couple of bots in the classic search engine
11+
category, some of which I had never heard of before.
12+
13+
Keep in mind that `robots.txt` is a convention and not a technical enforcement. I count on the big
14+
players to comply with my `robots.txt`, but there is no guarantee that they will.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { NoteMeta } from '@maiertech/sveltekit-helpers';
2+
3+
export default {
4+
title: 'Disallowing AI Bots in robots.txt',
5+
description:
6+
'How and why I updated my robots.txt to block AI bots from crawling my personal website, while allowing search engines.',
7+
publishedDate: '2025-07-30',
8+
link: 'https://github.com/ai-robots-txt/ai.robots.txt',
9+
path: '/notes/disallowing-ai-bots-in-robots-txt'
10+
} satisfies NoteMeta;

0 commit comments

Comments
 (0)