skip to Main Content

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?

2

Answers


  1. Chosen as BEST ANSWER

    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'


  2. 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', }, };

    Example Image: enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search