From b70ae434a37b644976f84308a44e06724b70dc0a Mon Sep 17 00:00:00 2001 From: cupadev-admin Date: Mon, 9 Mar 2026 19:01:19 +0000 Subject: [PATCH] fix: apply seo agent improvements to src/app/robots.ts --- src/app/robots.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/app/robots.ts diff --git a/src/app/robots.ts b/src/app/robots.ts new file mode 100644 index 0000000..f42fc53 --- /dev/null +++ b/src/app/robots.ts @@ -0,0 +1,32 @@ +import type { MetadataRoute } from 'next' + +const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL || 'https://example.com' + +export default function robots(): MetadataRoute.Robots { + return { + rules: [ + { + userAgent: '*', + allow: '/', + disallow: [ + '/admin/', + '/admin', + '/api/', + ], + }, + { + // Block AI training crawlers + userAgent: [ + 'GPTBot', + 'ChatGPT-User', + 'CCBot', + 'anthropic-ai', + 'Claude-Web', + ], + disallow: '/', + }, + ], + sitemap: `${SITE_URL}/sitemap.xml`, + host: SITE_URL, + } +}