RoastMyOpsec

News

JSON-LD vs Microdata for Public Sites

July 8, 2024

JSON-LD vs Microdata for public sites is an encoding decision for the same Schema.org types: JSON-LD is a script block you can maintain beside the template, while Microdata weaves itemprop attributes into the visible HTML. Google Search Central prefers JSON-LD for most sites. Structured data is not access control, and RoastMyOpsec does not score missing JSON-LD as a standalone F.

The practical difference

JSON-LD is a JSON document in <script type="application/ld+json">. It can describe Organization, WebSite, Article, BreadcrumbList, and FAQ without touching every heading. Microdata uses itemscope, itemtype, and itemprop on existing elements so the markup and the visible text stay tied together.

The OPSEC miss is the same in both encodings: stuffing internal emails, office floor maps, or unpublished product SKUs into structured data “for rich results.” Schema.org is a public graph. If you would not put it in the footer, do not put it in JSON-LD.

RDFa exists as a third encoding. For a marketing Next.js or CMS site, JSON-LD is the path of least drama. Microdata still appears in older themes. Do not ship both with conflicting names and URLs.

How to choose based on what you shipped

Choose JSON-LD unless a theme already has accurate Microdata you do not want to fork. Keep types aligned with visible content. Skip Review spam and fake breadcrumbs. Organization and WebSite on the homepage are enough for most brochure origins.

OptionWhen it winsWatch-outTakeaway
JSON-LDYou want one maintainable graph next to the templateEasy to drift from visible copyDefault for public marketing sites
MicrodataThe theme already annotates visible nodes correctlyMessy with components and hydrationFine if it already matches the page
No structured dataA tiny brochure with nothing to describeNot a security failureOptional for OPSEC
Both encodingsAlmost neverConflicting names, URLs, and typesPick one source of truth

When Microdata still wins

Microdata still wins on a long-lived theme where itemprop already mirrors the visible byline and you would create drift by adding a second graph. JSON-LD still wins for new pages, FAQs, and anything a component library would butcher as attributes. Missing both is not a roast F.

Common mistakes

The first mistake is duplicating JSON-LD and Microdata with different canonical URLs or brand names.

The second mistake is putting non-public emails or internal hostnames into Schema.org.

The third mistake is treating missing JSON-LD as a security finding.

What a URL roast can prove

RoastMyOpsec does not parse or grade JSON-LD, Microdata, Open Graph, RSS, or hreflang as standalone Fs. The free roast is headers, TLS, cookies, bounded sensitive paths (.git/HEAD, .env, package.json signatures), and js-secrets on a URL you assert you own. Structured data is a content graph; keep secrets out of it and confirm rich results in Search Console.

Free audit the URL you own

RoastMyOpsec is a defensive public-surface roast: headers, cookies, sensitive paths, and more — no exploit payloads. Start with the free audit, then open the vault if the blurred findings look expensive.

Free audit now

FAQ

Does Google prefer JSON-LD or Microdata?
Google documents JSON-LD as the recommended format for most structured data. Microdata still works if it is correct and visible.
Is missing Schema.org a vulnerability?
No. It is optional public metadata. Missing it is not a roast F.
Can JSON-LD hide information?
No. It is in the document anyone can fetch. Do not put unpublished facts in the graph.

Sources

Related guides