Skip to content

No Title in Document Head

Source URL: https://nextjs.org/docs/messages/no-title-in-document-head

Prevent usage of <title> with Head component from next/document.

A <title> element was defined within the Head component imported from next/document, which should only be used for any <head> code that is common for all pages. Title tags should be defined at the page-level using next/head instead.

Within a page or component, import and use next/head to define a page title:

import Head from 'next/head'
export function Home() {
return (
<div>
<Head>
<title>My page title</title>
</Head>
</div>
)
}