首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“Sitelinks搜索框模板中有一个错误: INVALID_SYNTAX”

“Sitelinks搜索框模板中有一个错误: INVALID_SYNTAX”
EN

Stack Overflow用户
提问于 2019-06-27 16:53:31
回答 1查看 619关注 0票数 0

以下错误发生在我网站的所有页面上:

https://www.newworldproductions.net/{search_term_string}Video, Production, Services, Marketing, Minneapolis, Minnesota, Corporate Videos, Commercial Videos ( Sitelinks Search模板中有一个错误:INVALID_SYNTAX。)

错误发生在第9行:

代码语言:javascript
复制
{
    "@context": "https://schema.org/",
    "@type": "WebSite",
    "name": "New World Productions",
    "url": "https://www.newworldproductions.net/",
    "potentialAction": {
        "@type": "SearchAction",
        "target": "https://www.newworldproductions.net/{search_term_string}Video, Production, Services, Marketing, Minneapolis, Minnesota, Corporate Videos, Commercial Videos",
        "query-input": "required name=search_term_string"
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-27 17:33:17

target的实现似乎是错误的,正如这篇文章中所详述的那样。没有必要在字符串中列出您想要的搜索词,而且您甚至都不需要在当前代码中查找查询。尝试实现以下功能:

代码语言:javascript
复制
<script type="application/ld+json">
{
   "@context": "http://schema.org",
   "@type": "WebSite",
   "url": "https://www.newworldproductions.net/",
   "potentialAction": {
     "@type": "SearchAction",
     "target": "https://query.newworldproductions.net/search?q={search_term_string}",
     "query-input": "required name=search_term_string"
   }
}
</script>

另外,请记住,并不是每个网站都符合searchAction模式的条件。如果他们这么做了,每个人都会这么做。有一些指导方针,在链接的文章中有涉及。你可能需要更多的研究。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56795612

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档