Next.js Discord

Discord Forum

Next.js 14 (app) - metadata - Page still indexed

Unanswered
Yellowstripe scad posted this in #help-forum
Open in Discord
Yellowstripe scadOP
Hello, we added robots.txt into /app/ folder & created metadata const with robots: { index: false } into root layout.tsx but we still see that some of the pages can be searched. We have another layout.tsx inside deeper
- page.tsx, layout.tsx with metadata
- - (steps) some pages (some of them still can be found) - no metadata

My questions are:
- are metadata from root (app) layout.tsx inherited/shared to childrens or for every child layout I need to pass new metadata object - in this case (steps)/layout.tsx? I can see meta tag robots with noindex inside (steps) pages tho..

6 Replies

@Anay-208 | Ping in replies If you add `metadata` in `page.tsx` it'll only affect that specific page
Yellowstripe scadOP
Yeah Im aware of that but as I mentioned, we added metadata into root layouts.tsx
Can you just try accessing

/robots.txt and send the content
@Anay-208 | Ping in replies And what do you mean by “some of the pages can be searched”, like searched by?
Yellowstripe scadOP
I think I can close this one. It looks like ppl responsible for SEO didnt cleared google search console.
but yeah robots.ts are just as below and accesible from https://..../robots.txt
User-agent: *
Disallow: /