#Title Not Working in Head

13 messages · Page 1 of 1 (latest)

compact sinew
#

As the title says, I can't set the title of my pages using <Head>. I wanted each page to have a different title, of course, but unfortunately didn't work in this case. I really need help, thanks.

import Head from 'next/head';

export default function Home() {
  return (
    <>
      <Head>
        <title>NetVerse</title>
      </Head>
      <h1>Hello World!</h1>
    </>
  );
}
frosty foxBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

indigo shell
compact sinew
#

Yes, sure.

indigo shell
# compact sinew

you are using the app router. The <Head>-Tag is part of the pages router. I recommend you still using the app router, like you are doing now.

To apply the header, remove your <Head>-Tag.
Add a metadata to your page like this:

import type { Metadata } from 'next'
 
export const metadata: Metadata = {
  title: '...',
  description: '...',
}
 
export default function Page() {}
compact sinew
#

Alr.

indigo shell
compact sinew
#

1 min.

#

It worked.

#

Thank you so much!

indigo shell
frosty foxBOT
#
✅ Success!

This question has been marked as answered! If you have any other questions, feel free to create another post

Jump to answer

[Click here](#1247225928208220280 message)