Schema.org: What to use, Microdata or JSON-LD?

2020-04-16 02:44发布

问题:

The data markup Schema.org for search sites like Google, Yahoo!, Bing and Yandex is great for snippets. However, I perceive that most of webmasters use Microdata and almost never use JSON-LD. I learned about JSON-LD recently and I have some doubts:

Could I use it without compability problems with search engine?

回答1:

There can’t be a general answer:

  • Each consumer (search engine, tool, etc.) has its own conditions (what it supports for which feature).

  • Each syntax (JSON-LD, Microdata, RDFa, etc.) has its own advantages and disadvantages.

Specific example to illustrate the problem: Google recommends to use JSON-LD for some of their features, but doesn’t support it for some others (e.g., for their Products Rich Snippet).

For what it’s worth, JSON-LD and RDFa are both W3C Recommendations (while Microdata is part of WHATWG’s Living HTML standard, but no longer under development at W3C). So if you care about this, you might want to consider using RDFa instead of Microdata (see my comparison). RDFa and JSON-LD are, of course, quite different: with JSON-LD you’d have to duplicate your content, while you can reuse it with RDFa.