为什么Facebook返回错误的页面(影响Facebook Like和Share URL)? [英] Why is Facebook returning the wrong page (affects Facebook Like and Share URL)?

查看:98
本文介绍了为什么Facebook返回错误的页面(影响Facebook Like和Share URL)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们第一次发布博客文章时,Facebook经常(但并不总是)对该页面感到困惑。具体来说,如果您尝试使用博客页面上的Like按钮,或者如果您尝试通过您的个人资料上的共享链接进行共享,Facebook将会看到根博客页面,而不是实际的页面。例如,我们最近发布了:
http://thisorthat.com/blog/2010-song-of-the-year-round-1-results



如果用户喜欢它,它将返回以下标题:
http: /thisorthat.com/blog



当您通过FB Linter运行发布网址时,您可以看到问题。
http://developers.facebook.com/tools/linter?url=http://thisorthat.com/blog/2010-song-of-the-year-round-1-results



在Debug部分,它显示了一个额外的og:title,og:url,description和og:image(Debug部分的最后4行) 。这是从根目录的元数据。我们无法想像的是为什么。为什么Facebook在页面上看到正确的元数据,然后也从根目录中拉取元数据(并且使用不正确的方式填充Like按钮和共享URL工具的数据)?



另一个奇怪。几天后,FB数字出来了。当然,到那时候,相对来说,相对来说,相对来说,人们正在查看这篇文章。



更新 - 我要再次感谢Peter Bailey的回答,但是我们也发现有另一个问题,我们必须解决之前,Like按钮的工作。



问题是我们在尚未发布的帖子中显示Facebook Like按钮。这样做的问题是,FB然后无法解析URL,并且对于正确的URL无猜测。在我们的例子中,它总是猜到thisorthat.com/blog。不幸的是,它缓存了几天的猜测,该缓存不能被Linter清除。所以最终的解决方案是修复彼得建议的og:类型,还要从博客文章预览中删除Like按钮。非常重要的是,您不要在发布页面之前显示FB,或者如果您这样做,请更改URL。

解决方案

确定这是您的Open Graph类型的问题。

 < meta content =websiteproperty =og:type/ > 

Per 文档


使用文章对于
表示短暂内容的任何URL,例如
a新闻文章,博文,照片,
视频等。不要使用网站
这个目的。 网站博客
,旨在表示整个网站,
an og:类型标签与类型网站
博客应通常只出现在域的
根上。



When we first put up a blog post, Facebook often (but not always) gets confused about what the page is. Specifically, if you try to use the Like button on the blog page OR if you try to share via the Share link on your profile, Facebook will see the root blog page rather than the actual post page.

For example, we recently posted: http://thisorthat.com/blog/2010-song-of-the-year-round-1-results

If the user "likes" it, it returns the title for: "http://thisorthat.com/blog"

When you run the post URL through the FB Linter, you can see the problem. "http://developers.facebook.com/tools/linter?url=http://thisorthat.com/blog/2010-song-of-the-year-round-1-results"

In the Debug section it shows an extra og:title, og:url, description and og:image (the last 4 rows of the Debug section). This is the meta data from the root directory. What we cannot figure out is why. Why is Facebook seeing the correct meta data on the page and then also pulling the meta data from the root directory (and using that incorrectly to populate the data for the Like button and the Share URL tool)?

One other oddity. FB "figures it out" after a few days. Of course, by that time relatively few people are viewing the post.

UPDATE -- I want to thank Peter Bailey again for his answer, but we also discovered that there was another issue that we had to resolve before the Like button worked.

The issue was that we were displaying the Facebook the Like button on a post that was not yet published. The problem with this is that FB then can't resolve the URL and "guesses" as to the correct URL. In our case, it always guesses thisorthat.com/blog. Unfortunately, it then caches that guess for a number of days and that cache cannot be cleared by the Linter. So the ultimate solution was to both fix the og:type as Peter suggested, but also to remove the Like button from the blog post preview. It's very important that you don't show FB a page before it's published or if you do, change the URL.

解决方案

Pretty sure it's your Open Graph type that's the problem.

<meta content="website" property="og:type"/>

Per the documentation

Use article for any URL that represents transient content - such as a news article, blog post, photo, video, etc. Do not use website for this purpose. website and blog are designed to represent an entire site, an og:type tag with types website or blog should usually only appear on the root of a domain.

这篇关于为什么Facebook返回错误的页面(影响Facebook Like和Share URL)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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