如何修复“解析器不匹配的元数据”来自Facebook Open Graph调试工具的错误? [英] How do I fix a "Parser Mismatched Metadata" error from the Facebook Open Graph debug tool?

查看:135
本文介绍了如何修复“解析器不匹配的元数据”来自Facebook Open Graph调试工具的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从网站的 Facebook Object Debugger 收到错误最近添加的Open Graph标签到:


该元数据的解析器结果与输入的
元数据不匹配。可能的是,这是以
意外的方式排序的数据造成的,只有一个属性给出了多个值
,期望单个值,或者给定属性
不匹配的属性值。以下是在解析结果中没有看到
的输入属性=>内容对:'article:published_time =>
2012-05-15'


这是工具报告的元标记:

 元标记:< meta property =og:site_namecontent =Mysite.com/> 
元标签:< meta property =og:urlcontent =ful url/>
元标签:< meta property =fb:app_idcontent =a number/>
元标签:< meta property =article:published_timecontent =2012-05-15/>
元标签:< meta property =article:authorcontent =url to user profile page/>
元标签:< meta property =og:imagecontent =url to png/>
元标签:< meta property =og:typecontent =article/>
元标签:< meta property =og:titlecontent =Well Versed/>

起初我以为这是publish_time的日期格式问题,但该字段似乎遵循<一个href =https://developers.facebook.com/docs/opengraph/objects/builtin/#article =nofollow noreferrer> Facebook在其示例中使用的时间格式。我不知道是什么产生这个错误。订单是否重要?



更新:我将下面的答案标记为已接受,因为明确的人解决了这个问题。但是,这不是我的解决方案。这个堆栈溢出开放图解答已经成功了。

解决方案

我的解决方案听起来很奇怪,但是我使用trim解决了这个问题,题目是标题,我的标题是我的标题。
修剪字符串后,一切正常。在我看来,Facebook解析器不喜欢空格...至少尝试一下,看看是否修复了您的错误。



希望有帮助! p>

I'm getting an error from the Facebook Object Debugger for a web page I recently added Open Graph tags to:

The parser's result for this metadata did not match the input metadata. Likely, this was caused by the data being ordered in an unexpected way, multiple values being given for a property only expecting a single value, or property values for a given property being mismatched. Here are the input property =>content pairs that were not seen in the parsed result: 'article:published_time => 2012-05-15'

Here are the meta tags the tool reports:

Meta Tag:   <meta property="og:site_name" content="Mysite.com" />
Meta Tag:   <meta property="og:url" content="ful url" />
Meta Tag:   <meta property="fb:app_id" content="a number" />
Meta Tag:   <meta property="article:published_time" content="2012-05-15" />
Meta Tag:   <meta property="article:author" content="url to user profile page" />
Meta Tag:   <meta property="og:image" content="url to png" />
Meta Tag:   <meta property="og:type" content="article" />
Meta Tag:   <meta property="og:title" content="Well Versed" />

At first I thought it was a date form issue with published_time, but the field appears to follow the time format Facebook uses in their example. I'm not sure what is generating this error. Does the order matter?

UPDATE: I marked the answer below as accepted because clearly people solved this problem with his fix. However, this wasn't the solution that worked for me. This Stack Overflow open graph answer did the trick.

解决方案

My solution sounds weird but I solved this using trim, the problem was in the title, my title was something like "My title ". After trimming the string everything worked fine. It seems to me that Facebook parser doesn't like spaces... try it at least, look if that fixes the bug for you.

Hope that helps!

这篇关于如何修复“解析器不匹配的元数据”来自Facebook Open Graph调试工具的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆