So I know that to block Pinterest on my site I need to embed this in my site’s header <meta name="pinterest" content="nopin" />
, but I’m not sure how to do that in Next 13 using the new exported metadata object format? Looked at the documentation for that object but couldn’t figure it out.
export const metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
EDIT (April 18th):
I’m not sure why it seemed to be working before, but adding the meta tag as suggested by Mathieu (and the documentation) doesn’t seem to actually work.
I have this in my root layout file and pinterest pinning option still appears on my site
export const metadata = {
other: { pinterest: "nopin" },
};
2
Answers
it seems you just have to put your piece of code in your layout.js or page.js, like this :
to add custom metadata, you can use other category:
next build will generate this metadata:
More information here: https://beta.nextjs.org/docs/api-reference/metadata#other