How do I add a meta description to a Next.js website?

coderguy asked this question 5 months ago
coderguy on Dec 3, 2021

My Next.js website needs a <meta name="description" /> HTML tag added to its <head>.

Next.js should have a built-in way to do this, correct?

1 suggested answers
itsbambi on Dec 8, 2021

You'll need to import the next/head component at the top of the page:

import Head from "next/head"

Then you can add a <Head> component to your page like this:

  <meta name="description" content="Your meta description." />

Make sure it's positioned at the top of the return () method inside your React.js page.

0 replies