open graph debugger tool errors inferred property

这一生的挚爱 提交于 2019-12-14 02:33:14

问题


the past few days I've been working to get a facebook comment box installed on my blog that I've set up with open graph tags so that my blog can be liked as a facebook page. From what I can see on the page, all seems to be functioning normally, but when I run my blog address through the debugger, I get the following errors.

Here is the link to my site: www.mommysnark.com

And here are the errors that the debugging tool gives me:

A like button warning that should be fixed: og:title is missing. The og:title meta tag is necessary for Facebook to render a News Feed story that generates a high clickthrough rate.

And finally, the open graph warnings that should be fixed:

Inferred Property:The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags.

Inferred Property:The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags.

Inferred Property:The 'og:description' property should be explicitly provided, even if a value can be inferred from other tags.

It appears that everything is working, so can these errors just be ignored?


回答1:


You'll want to correct all errors for best results. The properties og:title and og:url are especially important to your purposes. Here is the Open Graph stuff from my blog at formlesspoet.blogspot.com. You can use it for reference:

<!-- BEGIN FACEBOOK OPEN GRAPH -->
<b:if cond='data:blog.pageType == &quot;archive&quot;'>
    <meta expr:content='&quot;Posts from &quot; + data:blog.pageName + &quot; at Form and Formlessness&quot;' property='og:title'/>
</b:if>
<b:if cond='data:blog.pageType == &quot;index&quot;'>
 <b:if cond='data:blog.searchQuery'>
    <meta expr:content='&quot;Search results for “&quot; + data:blog.searchQuery + &quot;”&quot; + &quot; at Form and Formlessness&quot;' property='og:title'/>
 </b:if>
 <b:if cond='data:blog.searchLabel'>
    <meta expr:content='&quot;Posts tagged under “&quot; + data:blog.searchLabel + &quot;”&quot; + &quot; at Form and Formlessness&quot;' property='og:title'/>
 </b:if>
 <b:if cond='data:blog.searchQuery == &quot;&quot;'>
  <b:if cond='data:blog.searchLabel == &quot;&quot;'>
    <meta expr:content='&quot;Form and Formlessness&quot;' property='og:title'/>
  </b:if>
 </b:if>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
    <meta expr:content='&quot;“&quot; + data:blog.pageName + &quot;”&quot; + &quot; at Form and Formlessness&quot;' property='og:title'/>
</b:if>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
    <!--Static Page-->
</b:if>

<meta content='article' property='og:type'/>
<meta content='This blog follows an exploration of poetry by Zahhar, going as far back as 1995. Posts include his poetry and articles about poetry, prosody, and poetics.' property='og:description'/>

<meta expr:content='data:blog.url' property='og:url'/>   
<meta content='http://sphotos.xx.fbcdn.net/hphotos-ash3/538645_3357819035748_1577184006_2624573_712999292_n.jpg' property='og:image'/>
<meta content='1577184006' property='fb:admins'/>
<meta expr:content='data:blog.title' property='og:site_name'/>   
<!-- END FACEBOOK OPEN GRAPH -->

Note that the og:title property is set differently depending on what sort of page you're looking at. I'm trying to find a way to refine this further, but I'm still waiting on an answer. The og:description and og:url properties can be found near the bottom. Note that I'm using some Blogger specific stuff to get the title and URL of the current page for the og:title and og:url properties. You'll want to do the same. Presently the og:description property is static, but I plan to eventually find a way to make it more versatile. Still working on learning how. The URL used for the og:image property is actually linked to a photo in one of my Facebook albums.



来源:https://stackoverflow.com/questions/9712897/open-graph-debugger-tool-errors-inferred-property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!