Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off schema #1297

Closed
matthewbeta opened this issue Mar 2, 2023 · 2 comments
Closed

Turn off schema #1297

matthewbeta opened this issue Mar 2, 2023 · 2 comments
Labels

Comments

@matthewbeta
Copy link

Question

Hi. We have a client that is using a 3rd party specialist for SEO management. They are planning to add their schema data via GTM (which is a thing apparently). Is there a way to disable the schema data coming from the plugin (at the entry or site level)? I can't find anyway to do this via the docs, issues, or plugin settings. Apologies if this is covered and I haven't been able to find it.

Additional context

N/A

@khalwat
Copy link
Collaborator

khalwat commented Mar 2, 2023

Yes, there is. You can disable the JSON-LD container entirely:

{% set jsonLdContainer = seomatic.jsonLd.container() %}
{% do jsonLdContainer.include(false) %}

https://nystudio107.com/docs/seomatic/using.html#meta-containers

https://nystudio107.com/docs/seomatic/using.html#json-ld-meta-object-functions-seomatic-jsonld

I would mention that their idea of using GTM to add the JSON-LD is not an optimal recommendation, because:

  • The JSON-LD will not be included on the page until JavaScript is parsed & executed, which Google in theory does, but I've seen issues with it at times. Additionally, pages that require JavaScript to be executed before parsing are put into a secondary queue by Google, which can delay the parsing
  • The JSON-LD will no longer be pulled from the CMS content, it will be hard-coded by them, which means if people change the content, the JSON-LD won't automatically change as well

What I would highly recommend instead is that you use the SEOmatic APIs to customize the JSON-LD as you see fit.

Docs: https://nystudio107.com/docs/seomatic/using.html#json-ld-meta-object-functions-seomatic-jsonld

Examples: https://nystudio107.com/blog/annotated-json-ld-structured-data-examples

If they are like most SEO agencies I'm familiar with, they will be resistant to doing this, mostly because it's outside of the realm of what they usually do. Good luck!

@khalwat khalwat closed this as completed Mar 2, 2023
@matthewbeta
Copy link
Author

matthewbeta commented Mar 2, 2023

Ah amazing. Yes we would rather they went that way too but I think you're right. They have a "Better the devil you know" take on this. I'll have a chat to them about it.

Cheers for the tips. And thanks as ever for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants