How to autogenerate Seo Meta Tags description per page

Hi,

I’ve been using DatoCMS for several projects already and I’m not having a clear understanding of the Seo Meta Tags.

I’m currently using DatoCMS with Gatsby via the source plugin.

For each page model I’m creating a SEOMetaTags attribute to fetch all the info. When I check the models via graphql I found out there’s a seoMetaTags (the one I created) and a seometatags which seems to be autogenerated.

The one I create returns all default information from the global SEO settings. The autogenerated one is empty.

I’m wondering what I’m doing wrong or what should I do in order to have meta tags autogenerated based on each page (e.g., I have a Blog Post Page and I want the SEO to adapt to the content without me having to manually touch each Seo Meta Tag).

Thanks in advance

Hey @chompas !

The Gatsby source plugin is behaving slightly differently.

You can have a look here: GitHub - datocms/gatsby-source-datocms: Official GatsbyJS source plugin to pull content from DatoCMS for more details.

In general the object that we provide is auto-generated, but instead the field that you have created should only have the content that you have written. Just be careful if you name them exactly the same as there might be a conflict?

Let me know if that makes sense!

So based on what you are saying I shouldn’t generate my own (my own SeoMetaTag attribute I mean)?

Hi @mat_jack1 . Removing my custom SeoMetaTag is making the default one return values. I think I was doing this before Dato was returning a default tag and then it was overriding the implementations.

Just one comment since I couldn’t find it. The autogenerated SEO is bringing the correct title but the default global description. Is there a particular name that needs to be used in the model to grab a dynamic description from it?

I think you should add a SEO field with a name different from seoMetaTags to avoid conflict with our implementation in the Gatsby plugin.

Then you fill the content there when you want to ovverride the defailts.

For the description field we don’t have a default field from which we pull information from, so we fallback on the global SEO settings for that.

Hope this summarize @chompas ?

1 Like

Yes @mat_jack1 . That makes sense. I incorrectly assumed the auto generated tags were abel to generate a custom description.

Thanks for your help.

1 Like