google-webmaster-tools
  • json-ld
  • 2015-04-25 83 views 0 likes 
    0

    我刚才登录到谷歌网站管理员工具,并正在寻找在涉及到一个新的WordPress主题的结构化数据的错误我使用:Google网站管理员工具:“解析您的JSON-LD时发生错误。”

    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”红色下划线。

    回答

    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> 
    
    相关问题