next-seo icon indicating copy to clipboard operation
next-seo copied to clipboard

next-seo dangerouslySetAllPagesToNoFollow and dangerouslySetAllPagesToNoIndex does not allow override

Open Mkhdv opened this issue 2 years ago • 1 comments

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

Mkhdv avatar Jun 08 '22 20:06 Mkhdv

We're experiencing the same problem. Documentation is contradicting and I'm not sure if this is how its intended to be.

barros001 avatar Jul 28 '22 21:07 barros001

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.

sunnysingh avatar Dec 23 '22 14:12 sunnysingh

I'd be interested in merging https://github.com/garmeeh/next-seo/pull/1062 too 🙏

solher avatar Jan 29 '23 11:01 solher

I'm also interested in merging #1062

ivadimko avatar Feb 21 '23 12:02 ivadimko

Please merge #1062

pakerhoi avatar Mar 21 '23 13:03 pakerhoi