Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Facebook returning the wrong page (affects Facebook Like and Share URL)?

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.

like image 313
Jon Kelly Avatar asked Jan 19 '11 17:01

Jon Kelly


People also ask

Why has Facebook changed pages?

The new Page layout is meant to make it easier for visitors to a Page to see key information, like the Page's bio and posts. Notably, the design does away with the Page Likes and the Like button. Instead, the Page will only display a Follow button and follower count. This change better reflects the Page's true reach.

Why is my Facebook URL not working?

You might not be seeing the Facebook link preview you want because the info has been cached by Facebook. (Facebook saves the info from URLs and pages that have already been shared, for better performance.) So you just may need to force Facebook to clear the cache.

Why is Facebook not loading properly?

Try refreshing your browser or reopening the site; on a mobile app, close and reopen the app. You can also check to see if Facebook is offline and then restart your device, update apps, and clear your cache.


1 Answers

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.

like image 78
Peter Bailey Avatar answered Sep 20 '22 14:09

Peter Bailey