All my pages are working with getStaticProps.
I want to make "If there's and q parameter on URL, then add 'noindex' to ".
But as you can understand, that doesnt work on 'prerendered' pages.
But I have to find a way.
I need to add 'noindex' to all my 'shop?q=blabla' pages.
On _app.js I did like that:
function MyApp({ Component, pageProps }) {
const router = useRouter()
...
return (
<Fragment>
<Head>
...
{router.query.q ? <meta name="robots" content="noindex"></meta> : '' }
...
But not working on getStaticProps pages.
Is there any advice about it?
How can I automatically add 'noindex' to all of the 'q' parametered pages?