Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Adding Open Graph meta tags to the head without react - helmet

NOTE : This info may be out of date. Run a few tests before putting it in production. I tried this other approach , but that has a problem with the fact that the page gets delivered with default metadata then updated via script. The result being that the customized OG social card stuff doesn't show up.

Looking to add metatags to my next.js site, everything I found pointed to react - helmet, but that was throwing the error TKTKTKTKT. There are some work arounds, but I figured there was an easier way.

I ended up using the default [TODO: Code shorthand span ] and ` < Head > < /Head > `

The way I did it was to make a new component file at [TODO: Code shorthand span ] with the content :

import Head from 'next/head'

export default function MetaData({ description, image, title, type, url }) {
  return (
      <meta charSet="utf-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1">

      <meta name="description" content={description} />

      <meta property="og:description" content={description} />
      <meta property="og:image" content={image} />
      <meta property="og:title" content={title} />
      <meta property="og:type" content={type} />
      <meta property="og:url" content={url} />

      <meta name="twitter:card" content="summary_large_image" />
      <meta name="twitter:creator" content="@theidofalan" />
      <meta name="twitter:title" content={title} />
      <meta name="twitter:image" content={image} />

Then use it in the [TODO: Code shorthand span ] style pages :

return (
        description="A game of decryption"
       <div>Content Goes Here</div>

TOOD : Look at the other post about your full set of metadata tags