我正在尝试实现 Schema.org 标记( WebSite
类型):
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "Page URL",
"potentialAction": {
"@type": "SearchAction",
"target": "https://www.finelovedolls.com/fr/?s={search_term}&post_type=product",
"query-input": "required name=search_term"
}
}
</script>
这似乎是正确的
target
是我的网站在使用搜索框时作为可变 URL 返回的内容。但是,我在 Google SDTT 结果上遇到以下错误:
URL Template:
https://www.finelovedolls.com/fr/?s={search_term}&post_type=product
(There is an error in your Sitelinks Search Box template: OFF_DOMAIN.)
最佳答案
Google 的结构化数据测试工具似乎会检查主机是否来自 target
值与来自 url
的主机相同值(value)。
所以如果你使用 "url": "https://www.finelovedolls.com/fr/"
而不是 "url": "Page URL"
,测试工具不应再报告此错误。
关于schema.org - 结构化数据测试工具 : "There is an error in your Sitelinks Search Box template: OFF_DOMAIN",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43467113/