Google网站管理员工具:“解析您的JSON-LD时出错。”

时间:2015-04-25 12:28:33

标签: google-webmaster-tools json-ld

我刚刚登录Google网站站长工具,发现与我正在使用的新WordPress主题相关的结构化数据出错:

  

JSON-LD:解析你的JSON-LD时出错。

它所指的代码是:

<meta property="og:site_name" content="Townsville Nerds - Ph 0402 807 890" />
<script type='application/ld+json'>
    execOnReady(function({{"@context":"http:\/\/schema.org","@type":"WebSite","url":"http:\/\/www.townsvillenerds.com\/","name":"Townsville Nerds - Ph 0402 807 890"}})
</script>

注意:在网站站长工具中,“execOnReady”一词中的“e”下面有一个红色下划线。

1 个答案:

答案 0 :(得分:2)

您的数据块不包含有效的JSON-LD(application/ld+json)。

而不是

<script type='application/ld+json'>
    execOnReady(function({{"@context":"http:\/\/schema.org","@type":"WebSite","url":"http:\/\/www.townsvillenerds.com\/","name":"Townsville Nerds - Ph 0402 807 890"}})
</script>

应该是

<script type='application/ld+json'>
    {"@context":"http:\/\/schema.org","@type":"WebSite","url":"http:\/\/www.townsvillenerds.com\/","name":"Townsville Nerds - Ph 0402 807 890"}
</script>

我猜你不需要逃避/,所以它可能是:

<script type="application/ld+json">
    {
     "@context": "http://schema.org",
     "@type": "WebSite",
     "url": "http://www.townsvillenerds.com/",
     "name": "Townsville Nerds - Ph 0402 807 890"
    }
</script>