Site SEO AI Auditby Internet Solutions

JSON-LD vs Microdata vs RDFa: Which Structured Data Format?

25 tháng 9, 20268 phút đọcSEO kỹ thuật
JSON-LD vs Microdata vs RDFa: Which Structured Data Format?

Short answer: JSON-LD, Microdata and RDFa are three syntaxes for adding the same Schema.org structured data to a page. JSON-LD puts the data in a separate script block; Microdata and RDFa add attributes to the visible HTML elements. Google supports all three but recommends JSON-LD because it is easier to write, maintain and generate from data. For new work, use JSON-LD; for existing Microdata that is valid, migrate only when you are rebuilding templates anyway.

What they have in common

All three formats express structured data: machine-readable statements such as “this page is a Product named Trail X, priced 89 euros, in stock”. In SEO, the vocabulary used is almost always Schema.org, which defines types such as Product, Article, Organization, LocalBusiness, Event and BreadcrumbList, and their properties. The format is just the way those statements are written into the page.

Choosing a format is therefore mostly a question of maintenance, not of search performance. The format decides who can edit the markup, how easily it is generated from your data, how likely it is to break during a redesign and how quickly problems can be found. Those practical questions should drive the choice, especially on sites where content is edited by several people and templates change over the years.

Search engines read the statements, not the format. A valid Product in JSON-LD and the same valid Product in Microdata are equivalent for rich result eligibility. Google’s introduction to structured data lists the supported formats and recommends JSON-LD.

The three formats

Here is how each format looks in practice, with its main strengths and weaknesses. The examples describe simple entities; real pages usually combine several types, such as an Organization, a WebPage and a Product or Article.

JSON-LD

JSON-LD (JavaScript Object Notation for Linked Data) places the data in a <script type="application/ld+json"> block, usually in the head or at the end of the body:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Example Ltd",
  "url": "https://www.example.com/",
  "logo": "https://www.example.com/logo.png"
}
</script>

Strengths:

Weakness: because it is separate, it can drift out of sync with the visible content, for example showing an old price, if it is not generated from the same data.

Microdata

Microdata adds attributes to existing HTML elements: itemscope, itemtype and itemprop:

<div itemscope itemtype="https://schema.org/Product">
  <h1 itemprop="name">Trail X</h1>
  <div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
    <span itemprop="price" content="89.00">€89</span>
    <meta itemprop="priceCurrency" content="EUR">
  </div>
</div>

Strengths:

Weaknesses:

RDFa

RDFa (Resource Description Framework in attributes) also uses HTML attributes, such as vocab, typeof and property. It is more general than Microdata and can mix several vocabularies, which is why it appears in some publishing and government systems and in certain CMS platforms. For typical business websites and shops, it offers no advantage over JSON-LD and has the same fragility as Microdata.

Side-by-side comparison

JSON-LD Microdata RDFa
Location Separate script block Attributes in HTML Attributes in HTML
Google recommendation Recommended Supported Supported
Ease of maintenance High Low to medium Low to medium
Risk from redesigns Low High High
Risk of mismatch with page Medium, if not generated from same data Low Low
Linking entities Easy with @id and @graph Possible, clumsy Possible
Typical source SEO plugins, modern frameworks Older themes, shop templates Some CMS and publishing systems

Mixing formats: the duplicate problem

You can use different formats on the same page, but describing the same entity twice, once in Microdata from the theme and once in JSON-LD from a plugin, is a common source of problems. Search engines may see two Products with slightly different data, two Organizations with different logos, or two BreadcrumbLists with different paths. Results range from ignored markup to warnings in Search Console.

Before adding JSON-LD through a plugin, check the page source for itemscope, itemtype and typeof attributes. If the theme already outputs Microdata for the same types, disable one of the sources.

Migrating from Microdata to JSON-LD

  1. Inventory the types and properties currently marked up on each template, using the Rich Results Test or a crawl that extracts structured data.
  2. Build equivalent JSON-LD from the same data sources the template uses, so values stay identical to what is displayed.
  3. Remove the Microdata attributes in the same release, to avoid a period of duplicates.
  4. Test on staging with the Rich Results Test for every template.
  5. Monitor Search Console’s enhancement reports for a few weeks after release.

If the existing Microdata is valid and complete, there is no urgency. Migration is best done during a theme update or redesign, when templates are being rewritten anyway. Until then, focus on keeping the existing markup accurate and complete.

Connecting entities with @id and @graph

One of JSON-LD’s practical advantages is how easily it connects entities. Instead of repeating the full Organization inside every Article as publisher, you describe the Organization once with an @id, such as https://www.example.com/#organization, and refer to it from other entities by that identifier. A @graph array holds all the entities for the page in one block:

Many SEO plugins produce exactly this structure. The benefit is consistency: the organisation’s name and logo are defined once, so they cannot drift apart between templates. When debugging, check that every @id reference points to an entity that actually exists in the graph.

Which types most sites need

The format question matters less than choosing the right types. For most small business sites, shops and blogs, a short list covers the essentials:

Adding every possible type does not help. Accurate, complete markup for the content you actually have does.

Where to place JSON-LD

How Site SEO AI Audit checks structured data

Structured data is one of the seven areas in the audit. SEOAuditBot reads the Schema.org markup on each page and reports invalid JSON-LD and pages without structured data, along with Open Graph tags and share images. Because issues are weighted by how many pages they affect, a template that outputs broken JSON or no markup at all stands out clearly. WordPress sites get the steps to fix it in the relevant plugin. See plans.

Related reading

The bottom line

JSON-LD, Microdata and RDFa carry the same Schema.org data in different ways. Use JSON-LD for new work because it is easiest to generate, test and maintain; keep valid existing Microdata until you rebuild the templates; and never describe the same entity twice in different formats.

FAQ

Is JSON-LD better for SEO than Microdata?

Not for rankings or eligibility: search engines treat valid data in either format the same way. JSON-LD is recommended because it is easier to implement and less likely to break.

Can I use JSON-LD and Microdata on the same page?

Yes, but avoid describing the same entity in both. Duplicate, conflicting descriptions of the same product or organization can cause the markup to be ignored or produce warnings.

Does JSON-LD have to be in the head?

No. It can be placed in the head or the body. What matters is that it is in the page’s HTML and valid.

Should I convert my existing Microdata to JSON-LD?

If it is valid and complete, there is no urgency. Convert when you are redesigning or rebuilding templates anyway, and remove the Microdata in the same release.

Can JSON-LD include information not shown on the page?

It should describe the page’s content. Some supporting details, such as identifiers, are acceptable, but important facts like prices, ratings and availability must match what visitors see.

#JavaScript SEO#Structured data#Technical SEO
Kiểm tra website của bạn — miễn phí.Mọi lỗi SEO trên website của bạn — và cách sửa chính xác.
Bắt đầu miễn phí
Internet Solutions

Sản phẩm khác từ đội ngũ chúng tôi

Do Internet Solutions phát triển. Hãy thử các sản phẩm khác của chúng tôi — mỗi sản phẩm giúp bạn tiết kiệm thời gian theo một cách riêng.

internet-solutions.net ↗
01Tự động đăng mạng xã hội
PostRSS

Bài mới từ nguồn cấp RSS của bạn được tự động đăng lên Facebook, X, LinkedIn, Telegram và hơn 60 mạng khác.

Gói miễn phí · từ 2014Truy cập →
02Chat trực tuyến AI cho website
Talkmio

Website của bạn trả lời khách truy cập 24/7 từ chính nội dung của bạn, bằng ngôn ngữ của họ.

Gói miễn phí · không cần thẻTruy cập →
03Trợ lý AI
Ask Mio

Trò chuyện, viết code, thiết kế, viết bài và nghiên cứu. Mio chọn mô hình tốt nhất cho từng việc.

Gói miễn phíTruy cập →
04Lái tự động AI cho blog và mạng xã hội
AI Blog Autopilot

AI viết bài SEO dài 2.000–3.000 từ và chia sẻ từng bài lên hơn 58 mạng xã hội.

3 bài đầu tiên miễn phíTruy cập →
05Kiểm tra sức khỏe website
Site AI Audit

SEO, tốc độ, SSL, bảo mật và cấu hình email trong một báo cáo, sắp xếp theo việc cần sửa trước.

Lần kiểm tra đầu tiên miễn phíTruy cập →
06Nguồn cấp RSS và sản phẩm
RSS Feed Creator

Tạo RSS từ bất kỳ trang web nào, cùng nguồn cấp sản phẩm cho Google và Meta tự động cập nhật.

Gói miễn phíTruy cập →
07Phát triển website và SEO
Internet Solutions

Website, cửa hàng trực tuyến và hệ thống theo yêu cầu, do đội ngũ của chúng tôi thiết kế, xây dựng và vận hành.

Từ 2011Truy cập →
Site SEO AI Audit
Tổng quan quyền riêng tư

Website này dùng cookie để mang lại trải nghiệm người dùng tốt nhất có thể. Thông tin cookie được lưu trong trình duyệt của bạn và thực hiện các chức năng như nhận ra bạn khi bạn quay lại, giúp đội ngũ chúng tôi hiểu phần nào của website bạn thấy thú vị và hữu ích nhất.