Avoid Duplicate Meta Description and Keywords in Next js

0 votes

I'm developing my website with Next.js To upgrade my website's SEO performance, I'm trying to avoid duplicated meta tags.

My Question

In Next official docs, they say that I can avoid overlapped meta tag by insert key property in meta tag. But this does not work.

<meta name="description" content="~~" key="titleDescription"/>
<meta name="keywords" content="~~" key="titleKeywords"/>

These are default rootDocument meta tags and,

<meta name="description" content={item.product_description} key="titleDescription"></meta>
<meta name="keywords" content={item.brand_name} key="titleKeywords"></meta>

These are dynamically generated meta tags in item pages.

In deployed browser, there are still two description and keywords meta tags in website. I want to avoid duplicated meta tag. Thank you for your help!se

Feb 21 in Others by Kichu
• 19,040 points
1,236 views

1 answer to this question.

0 votes

First of all take a deep look into this  https://github.com/garmeeh/next-seo you will get a clear idea 

Next.js recommends that all the dynamic <meta /> tags should only be defined on an individual page level.

Notice that your meta tags in the _document.js file are self-closing: <meta /> and the dynamic ones are not: <meta></meta>.

Ensure you are consistent with it

answered Feb 22 by narikkadan
• 37,660 points

Related Questions In Others

+1 vote
1 answer

what is the difference between error and stderr in Node.js?

Error is an object created by Node.js to handle ...READ MORE

answered Jul 4, 2019 in Others by sunshine
• 1,280 points
1,300 views
0 votes
1 answer
0 votes
1 answer

Next JS Seo with static pages, SSR Pages and Client Side rendering

Use getStaticProps()  with a revalidate property because sites ...READ MORE

answered Feb 20 in Others by narikkadan
• 37,660 points
615 views
0 votes
1 answer

Yoast plugin is not showing meta description and meta keyword

function set_head_keywords() { $id ...READ MORE

answered Feb 24 in Others by narikkadan
• 37,660 points
255 views
0 votes
1 answer

Next seo test with react testing library

 you need to mock next/head, pass document.head to the container ...READ MORE

answered Feb 11 in Others by narikkadan
• 37,660 points
661 views
0 votes
1 answer

Error:Parse Error: Adjacent JSX elements must be wrapped in an enclosing tag

Hello @kartik, It is happening because any where ...READ MORE

answered Jun 4, 2020 in Angular by Niroj
• 82,800 points
1,841 views
0 votes
1 answer

Error:setState doesn't update the state immediately

Hello @kartik, The method setState() takes a callback. And ...READ MORE

answered Jun 4, 2020 in Angular by Niroj
• 82,800 points
4,245 views
0 votes
1 answer

How to set meta tags using Angular universal SSR and ngx-seo plug-in?

first Install the plug-in with npm i ngx-seo ...READ MORE

answered Feb 11 in Others by narikkadan
• 37,660 points
1,133 views
0 votes
1 answer

How to make Component Variant in Google Optimize A/B testing in Next js

Render all the components in ReactJs after ...READ MORE

answered Feb 18 in Others by narikkadan
• 37,660 points
477 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP