
How To Add Robots Meta Attribute In Nextjs 13 Ssr Components
You can easily defines metadata attributes if you use SSR components in NextJS 13

Using "robots" meta attribute might help you to protect the pages that you don't want to share with internet.
You can use "robots" meta attribute for your authentication only pages like admin/user pages.
Metadatas only available in SSR components so you can't put metadata in the components that includes "use client" code line.
The comment line is for Typescript, if you don't use Typescript you can remove the line.
// export const metadata: Metadata = {
export const metadata = {
title: "Auth Protected Page",
robots: {
index: false,
follow: false,
googleBot: {
index: false,
follow: false,
},
},
};
0
0