JSON-LD vs microdata vs RDFa: which format to use
Google recommends JSON-LD, but microdata and RDFa still turn up in older themes and plugins. Here is how the three differ, and when mixing them causes problems.
Structured data has three formats, but most sites only need to know about one. JSON-LD is what Google recommends, what most tools generate, and what almost every guide, including ours, shows in examples. Microdata and RDFa still exist in the wild, mostly because an older theme or plugin put them there years ago and nobody swapped them out. Knowing the difference matters more when you're debugging someone else's markup than when you're writing your own.
The three formats, in plain terms
All three formats describe the same thing: a machine-readable annotation that says this block of text is a review, or this price is in USD, or this person is the author. They just attach that meaning to the page differently.
- JSON-LD: a separate block of JSON inside a script tag with type application/ld+json. It sits apart from the visible HTML and describes the page as data.
- Microdata: attributes like itemscope, itemprop, and itemtype added directly to the HTML tags that already hold the content.
- RDFa: similar to microdata, but built on attributes like property and typeof, originally designed for a broader set of vocabularies than schema.org.
Why JSON-LD is the default now
Google's own structured data documentation shows JSON-LD examples first, and has for years. That preference shapes everything downstream: the plugins built for WordPress, Shopify, and other platforms almost all output JSON-LD by default, and most schema generators and validators assume it too.
The practical reason is separation. JSON-LD lives in one script tag, so a developer or a tag manager can add, edit, or remove it without touching the template that renders the visible page. Microdata and RDFa are woven into the same tags as the visible content, so changing the markup risks changing the layout, and changing the layout risks breaking the markup.
That separation also makes JSON-LD easier to inject through Google Tag Manager or a similar tool, which is why so many sites retrofit structured data that way instead of rebuilding templates.
When you'll still run into microdata or RDFa
You're most likely to find microdata on sites built on an older WordPress theme, or on ecommerce platforms where product and review markup was added straight into the product template years ago. RDFa shows up more on Drupal builds and on sites that adopted structured data early, before JSON-LD became the default recommendation.
Open Graph tags, the og:title, og:image, and similar meta tags that Facebook and other platforms read, are technically RDFa-based, though they aren't part of schema.org and don't affect Google's structured data results. Don't confuse the two when you're auditing a page's head section.
What happens if you mix formats on one page
Google's guidance is straightforward: don't describe the same entity twice in two different formats on the same page. If your theme already marks up a product with microdata and a plugin adds the same product again in JSON-LD, you now have two descriptions of one thing, with no guarantee they agree with each other.
There's no confirmed evidence that mixed formats trigger a penalty on their own. The real cost is debugging. When the Rich Results Test flags an error, you have to check two places instead of one, and conflicting values between them can make it unclear which one search engines are actually reading. Treat one page, one format per entity as a maintenance rule, not a ranking rule.
Structured data describes what's already on the page. It doesn't decorate it, and it doesn't fix content that isn't there.
Moving from microdata or RDFa to JSON-LD
- Run the page through Google's Rich Results Test and note every entity the existing markup declares.
- Rebuild each entity as JSON-LD, matching the same properties. Don't add fields the old markup didn't have.
- Remove the old microdata or RDFa attributes so the entity isn't declared twice.
- Re-test the page and confirm the same rich result types still validate.
- Spot-check a sample of templates, not just one page, since a single theme file often powers hundreds of URLs.
If you're starting from scratch, use JSON-LD and don't think about the other two. If you inherited a site with microdata or RDFa already in place and it validates clean, leaving it alone is a reasonable call. The format matters far less than whether the data is accurate and matches what's actually on the page.