In several cases you might need to mix structured data using different formats like microdata and json-ld; in this article we review the do’s and don’ts for these edge cases.
Can I mix microdata and json-ld?
Yes, it is totally fine to use both syntaxes side by side on the same page but Google will not be able to merge attributes for the same entity using the item ID unless you are using json-ld ONLY.
Let’s get into the details:
- I can have on the same page both syntaxes (microdata and json-ld); for instance I might use microdata to render WebPage and use json-ld for Organization;
- I can also merge attributes related to the same entity when all the data is available in json-ld but …
- I cannot combine information related to the same entity by item ID when this information is written in microdata and json-ld. While this is possible in principle, and a pure RDF application would be able to do it, Google does not support it, which means properties won’t be merged and, most importantly, this won’t satisfy the Rich Snippets‘ requirements.
This topic is particularly relevant as microdata remains today the most widely used format for structured data (see data below collected by Aaron Bradley from the 2019 Common Crawl’s sample) and there is a huge demand to improve structured data to gain additional visibility on Google’s SERP.
— Aaron Bradley (@aaranged) January 14, 2020
To confirm that we cannot mix attributes by item ID when combining microdata and json-ld we asked the help of several SEOs with in-depth knowledge on structured linked data, including Dan Brickley, Jarno van Driel, Jono Alderson, Richard Wallis and Mark and Martha van Berkel.
Before engaging with the community we created two examples HTML pages:
- json-ld + microdata: here is the result validated with the Google Structured Data Testing Tool (where you will see the “Unspecified Type” error since GSDTT cannot merge the two syntaxes);
- json-ld + json-ld: here we can see that GSDTT supports the merge by type ID when data is written in json-ld
Interesting enough the first example would be properly rendered by the Structured Data Linter: a tool designed to help webmaster validate structured data markup. Here follows the information from the Twitter thread and the messages by Dan Brickley and Jarno van Driel:
in general you can use both syntaxes side by side, but you won’t get the fine-grained merging of triples by ID that a pure RDF application might expect
— Dan Brickley (@danbri) January 14, 2020
I think @danbri already was pretty clear. Highly doubt you’ll get a different answer from other Googlers.
— Jarno van Driel (@JarnoVanDriel) January 14, 2020
READY TO AUTOMATE YOUR STRUCTURED DATA MARKUP?
Book a call with us and join our list of happy customers!
Must Read Content
The Power of Product Knowledge Graph for E-commerce
Dive deep into the power of data for e-commerce
Why Do We Need Knowledge Graphs?
Learn what a knowledge graph brings to SEO with Teodora Petkova
Generative AI for SEO: An Overview
Use videos to increase traffic to your websites
SEO Automation in 2024
Improve the SEO of your website through Artificial Intelligence
Touch your SEO: Introducing Physical SEO
Connect a physical product to the ecosystem of data on the web