next-seo
next-seo copied to clipboard
next-seo dangerouslySetAllPagesToNoFollow and dangerouslySetAllPagesToNoIndex does not allow override
According to the documentation for next-seo plugin, we should be able to override dangerouslySetAllPagesToNoFollow and dangerouslySetAllPagesToNoIndex defined in <DefaultSeo> component on a page level via <NextSeo> component:
"You can still override this at a page level if you have a use case to index a page. This can be done by setting noindex: false."
I have added dangerously set options in default seo in _app.tsx:
<DefaultSeo
dangerouslySetAllPagesToNoIndex={true}
dangerouslySetAllPagesToNoFollow={true}
/>
and set nofollow/noindex to false for the pages I need indexed:
<NextSeo
nofollow={false}
noindex={false}
/>
yet I'm getting noindex/nofollow meta tags in rendered pages which have nofollow/noindex set to false:
<meta name="robots" content="noindex,nofollow">
<meta name="googlebot" content="noindex,nofollow">
when the expected tags should be:
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
Please let me know how this could be resolved, any help appreciated
We're experiencing the same problem. Documentation is contradicting and I'm not sure if this is how its intended to be.
Any ETA on merging #1062? I am also experiencing this issue and as Carlos mentioned the docs are contradicting.
Update: For now, here's a workaround with next/head
:
<Head>
{/* Workaround for https://github.com/garmeeh/next-seo/issues/967 */}
<meta key="robots" name="robots" content="index,follow" />
</Head>
Note that the key
prevents duplicate meta tags, and robots
is the same key used internally by next-seo.
I'd be interested in merging https://github.com/garmeeh/next-seo/pull/1062 too 🙏
I'm also interested in merging #1062
Please merge #1062