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 />
</>
);
}
CodePudding user response:
Actually this code should be working properly . Try adding meta description without og
before the og
description but not sure that will fix your problem.
< meta
property = "description"
content = "This is my personal blog website." />
<
meta
property = "og:description"
content = "This is my personal blog website." />
And also try removing .next
folder for removing cached code
CodePudding user response:
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.