Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultSeo robotsProps is overwritten by NextSeo #1134

Open
GreenDjango opened this issue Dec 19, 2022 · 3 comments
Open

DefaultSeo robotsProps is overwritten by NextSeo #1134

GreenDjango opened this issue Dec 19, 2022 · 3 comments

Comments

@GreenDjango
Copy link

Describe the bug
When NextSeo is used on a page, robotsProps from DefaultSeo is ignored.

Reproduction
https://codesandbox.io/p/sandbox/garmeeh-next-seo-1134-jiv1kj

// _app.tsx

import { DefaultSeo } from 'next-seo'
import type { AppProps } from 'next/app'

function MyApp({ Component, pageProps, router }: AppProps) {  
  return (
    <>
      <DefaultSeo
        robotsProps={{
          noimageindex: true,
          noarchive: true,
        }}
      />
      <Component {...pageProps} />
    </>
  )
}

export default MyApp
// index.tsx

import type { NextPage } from 'next'
import { NextSeo } from 'next-seo'

const HomePage: NextPage = () => {
  return (
    <>
      <NextSeo title="Home" />
      <div>HomePage</div>
    </>
  )
}

export default HomePage

Expected behavior

// Expected:
<meta name="robots" content="index,follow,noarchive,noimageindex">
// Got:
<meta name="robots" content="index,follow">

Additional context
dangerouslySetAllPagesToNoIndex and dangerouslySetAllPagesToNoFollow are not affected.

@fx69005
Copy link

fx69005 commented Feb 23, 2023

i have same problem

@GonzaloZiadi
Copy link

Same issue here as well. I've had to overwrite robotsProp at every page as the default setting isn't respected.

@andrekutianski
Copy link

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants