alexRicc2
alexRicc2

Reputation: 41

Nextjs13 app/dir metatag adding Google Search Console tag

I'm trying to add google search console to my nextjs13 app website, but their method of verifying is through a meta tag, and I don't know how to add metatag in nextjs13 app directoryenter image description here

I tried using the new api generateMetadata from https://nextjs.org/docs/app/api-reference/functions/generate-metadata but it seems they only work for some specific tags, like title, description, og, etc, my meta tag 'google-site-verification' does not work with this approach. How can I add this metatag?

Upvotes: 0

Views: 2165

Answers (2)

Raihan Ali
Raihan Ali

Reputation: 96

You have to do it exactly this way: code:

export const metadata: Metadata = {
  robots: { index: false, follow: false },
  title: 'Title',
  description:
    'your description',
  verification: {
    google: 'your verification content',
  },
};

Upvotes: 6

alexRicc2
alexRicc2

Reputation: 41

I was able to resolve exporting a const metadata in my page.tsx, and use the 'other' field like this enter image description here

the type Metadata in imported from next, import type {Metadata} from 'next'

Upvotes: 3

Related Questions