What the difference between JSON-LD and Microdata?

by seangibson 4 replies
Can any one explain what is the difference between Microdata and Json I want to add Search bar schema on my classified website what should I use?
#search engine optimization #difference #jsonld #microdata
Avatar of Unregistered
  • Profile picture of the author saurabh mathur
    Microdata- It is conceptually the syntax that defines the attribute that can be added to our existing HTML elements. If you want to make the use of your existing markup then always use Microdata as it is quite easier.

    JSON-LD- If you want to add the blob structure data without taking care about existing markup, then prefer JSON-LD. It is the syntax that gets added to script element separately from our existing markup.
    {{ DiscussionBoard.errors[11248411].message }}
  • Profile picture of the author guitarprince
    Consumers that support Microdata support Microdata, no matter if or where Microdata is specified.

    It’s conceivable that new consumers might decide not to support it, but the syntax is still very popular and still part of WHATWG’s HTML Living Standard, so it’s probably not going to vanish.

    About the consumer Google

    Some years ago, JSON-LD was not supported for many of their features, and they recommended that authors use Microdata (and they supported RDFa, too). Today it’s different.

    See Google’s Markup formats and placement:

    JSON-LD is the recommended format. Google is in the process of adding JSON-LD support for all markup-powered features. The table below lists the exceptions to this. We recommend using JSON-LD where possible.
    According to the mentioned table, Microdata and RDFa support all of Google’s data types, while JSON-LD supports everything except their Breadcrumbs feature.

    I wouldn’t give much weight to their recommendation. They say that "Structured data markup is most easily represented in JSON-LD format", but I think it’s safe to say that this only applies to authors that generate the structured data programmatically (especially from tools that support JSON).
    For authors that manually add the structured data markup, it’s typically easier to use Microdata or RDFa, and using these syntaxes minimizes the risk that an author updates the content without updating the structured data, too (see DRY principle).

    JSON-LD vs. Microdata vs. RDFa

    Unless you know (and care for) consumers that don’t support all three syntaxes, it doesn’t matter. Use what is easier for you and your tools.

    If you have no preference, I would say JSON-LD or RDFa, because contrary to Microdata,

    both are W3C Recommendations,
    both can be used in non-HTML5 contexts,
    both allow to (easily) mix several vocabularies.
    JSON-LD if you like your structured data not "intermingled" with your markup (= duplicating the content), RDFa if you like to use your existing markup (= not duplicating the content).
    {{ DiscussionBoard.errors[11251670].message }}
  • Profile picture of the author KevinWillis
    JSON-LD: JavaScript notation embedded in a <script> tag in the page head or body. The markup is not interleaved with the user-visible text, which makes nested data items easier to express. Also, Google can read JSON-LD data when it is dynamically injected into the page's contents, such as by JavaScript code or embedded widgets in your content management system.

    Microdata: An open-community HTML specification used to nest structured data within HTML content. Like RDFa, it uses HTML tag attributes to name the properties you want to expose as structured data. It is typically used in the page body, but can be used in the head.

    RAD Model
    {{ DiscussionBoard.errors[11252621].message }}
Avatar of Unregistered

Trending Topics