"There is an error in your Sitelinks Search Box template: INVALID_SYNTAX"

"There is an error in your Sitelinks Search Box template: INVALID_SYNTAX"

我网站的所有页面都出现以下错误:

https://www.newworldproductions.net/{search_term_string}Video, Production, Services, Marketing, Minneapolis, Minnesota, Corporate Videos, Commercial Videos (There is an error in your Sitelinks Search Box template: INVALID_SYNTAX.)

错误发生在第 9 行:

{
    "@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"
    }
}

target 似乎实施错误,详见 this article。无需在字符串中列出所需的搜索词,而且您甚至不需要在当前代码中查找查询。尝试执行以下操作:

<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 架构的条件。如果他们这样做了,每个人都会这样做。有指导方针,在链接的文章中有所涉及。您可能需要进行更多研究。