How does Google treat webpages with multiple JSON-LD Schema.org blocks?

前提是你 提交于 2019-12-04 04:47:47

问题


How do search engines like Google treat webpages with multiple JSON-LD (Schema.org) blocks?

For example, what would happen if a page has both non-conflicting script blocks below?

<script type="application/ld+json">
{   "@context":"http://schema.org",    
    "@type":"WebPage",
    "@id": "#123",
    "author": {
      "@type": "Person",
      "name": "Foo Bar"
    }
}
</script>
<script type="application/ld+json">
{   "@context":"http://schema.org",
    "@type":"WebPage",
    "@id": "#123",
    "text": "blah blah blah",
    "url":"pageurl"
  }
</script>

回答1:


We can’t know how Google Search actually treats them, but we can know how Google’s Structured Data Testing Tool handles such a case.

Same URI

If objects have the same URI (in JSON-LD: @id), they are the same. Google’s SDTT will display one entry showing properties from all objects with the same URI. So judging from the output in SDTT, Google seems to treat these two cases equally:

<script type="application/ld+json">
{   "@context":"http://schema.org",    
    "@type":"WebPage",
    "@id": "#123",
    "url":"pageurl",
    "text": "blah blah blah"
}
</script>
<script type="application/ld+json">
{   "@context":"http://schema.org",    
    "@type":"WebPage",
    "@id": "#123",
    "url":"pageurl"
}
</script>
<script type="application/ld+json">
{   "@context":"http://schema.org",
    "@type":"WebPage",
    "@id": "#123",
    "text": "blah blah blah"
}
</script>

Different (or no) URI

The default assumption is that the objects describe different things. However, if certain (typically unique) properties have the same values (telephone, address, name etc.), a consumer like Google Search might deduce that the objects describe the same thing -- this is not standardized, though, and if/when consumers do this is not documented.



来源:https://stackoverflow.com/questions/53510304/how-does-google-treat-webpages-with-multiple-json-ld-schema-org-blocks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!