Next.js Discord

Discord Forum

Robots "noindex" metatag automatically added

Unanswered
Atlantic salmon posted this in #help-forum
Open in Discord
Atlantic salmonOP
Hi,
As the title says my application's index.js file will always contain a <meta name="robots" content="noindex"/> tag and I can't pinpoint where it's coming from.

I've tried:
1. adding robots: "all" to the metadata field (screenshot 1), but then I get conflicting metadata fields in index.js (screenshot 2)
2. adding a robots.txt and a sitemap.xml file to the public folder

In both cases I'm wondering where the orignal tag is coming from. Every help is greatly appreciated!

3 Replies

It comes from the default page metadata. You can customize the behaviour as shown in this documentation page: https://nextjs.org/docs/app/api-reference/functions/generate-metadata#robots
Atlantic salmonOP
Thanks! Changing those defaults will add another meta tag though with the defaults still in place (screenshot 2). Any idea why?
@Atlantic salmon Thanks! Changing those defaults will add another meta tag though with the defaults still in place (screenshot 2). Any idea why?
White-crowned Sparrow
@Atlantic salmon did you ever solve this. I'm seeing the same issue.