Search code examples
javascriptreactjsnext.jsmeta-tags

nextjs meta tag details not appearing on social media post


I used nextjs builin Head for meta tags. But when I shared my link on facebook meta tag details not showing. Here is my code:

I added meta tag in my index.js:

export default function Home() {
  return (
    <>
      <Head>
        <meta
          name="og:title"
          content="I am Jhone. Full Stack Developer."
        />
        <meta property="og:type" content="website" />
        <meta property="og:url" content="my_website_link" />
        <meta property="og:site_name" content="my_website_name" />
        <meta
          property="og:description"
          content="This is my personal blog website."
        />

        <link rel="icon" href="/my.ico" />
      </Head>

      <About />
      <Experience />
      <Services />
      <Portfolio />
      <Contact />
      <Testimonials />
      <Footer />
    </>
  );
}

Solution

  • Actually my code was correct. I fixed the issue after visit https://developers.facebook.com/tools/debug/ then I put my website url and facebook scraper scrape my website and updated meta tags.