Pie*_*ode 14 url schema.org json-ld google-rich-snippets
当我从Google文档(下面的代码片段)中复制/粘贴JSON-LD示例时,我在结构化数据测试工具中收到错误:
http://www.your-company-site.com
(提供的所有值http://www.example.com/
必须具有相同的域.)
为什么Google自己的文档示例会出错?
Google文档中的代码段:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": "http://www.your-company-site.com",
"contactPoint": [{
"@type": "ContactPoint",
"telephone": "+1-401-555-1212",
"contactType": "customer service"
}]
}
</script>
Run Code Online (Sandbox Code Playgroud)
sid*_*rcy 10
看来测试工具假定example.com为其域.
在测试您是否可以将您的网址更新为"www.example.com"时,它将成功验证.
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": "http://www.example.com/",
"contactPoint": [{
"@type": "ContactPoint",
"telephone": "+1-401-555-1212",
"contactType": "customer service"
}]
}
</script>
Run Code Online (Sandbox Code Playgroud)
如果您将网址更改为" https://search.google.com/structured-data/testing-tool/ ",该工具会删除错误,只需确保在您将代码放入您更新网站的代码之前.
此外,检查Search Console可能是一种更可靠的方式(当前),以查看您的标记是否有错误.
归档时间: |
|
查看次数: |
9822 次 |
最近记录: |