diff --git a/front_end/src/app/(main)/questions/[id]/[[...slug]]/page.tsx b/front_end/src/app/(main)/questions/[id]/[[...slug]]/page.tsx index c95e3517e9..00fc3c548e 100644 --- a/front_end/src/app/(main)/questions/[id]/[[...slug]]/page.tsx +++ b/front_end/src/app/(main)/questions/[id]/[[...slug]]/page.tsx @@ -13,6 +13,12 @@ type Props = { searchParams: Promise; }; +const NOINDEX_DEFAULT_PROJECT_KEYWORDS = [ + "futureeval", + "AI Forecasting Benchmark Tournament", + "minibench", +]; + export async function generateMetadata(props: Props): Promise { const params = await props.params; const postData = await cachedGetPostForMetadata(params.id); @@ -21,6 +27,10 @@ export async function generateMetadata(props: Props): Promise { return {}; } const questionTitle = getPostTitle(postData); + const defaultProjectName = postData.projects?.default_project?.name ?? ""; + const shouldNoindex = NOINDEX_DEFAULT_PROJECT_KEYWORDS.some((keyword) => + defaultProjectName.toLowerCase().includes(keyword.toLowerCase()) + ); return { title: getValidString(postData.html_metadata_json?.title) ?? @@ -52,6 +62,7 @@ export async function generateMetadata(props: Props): Promise { alt: "community predictions", }, }, + ...(shouldNoindex ? { robots: { index: false, follow: false } } : {}), }; }