When you share a post on Facebook, it will display a thumbnail picked from the post page along with a short description of the post. But in many cases Facebook fails to identify the correct image and description that it should use. This leads to irrelevant images and description coming up in Facebook when you or your readers share the post. This is totally annoying, and I had got many queries regarding this on our Facebook page and via email. So for those who are trying to figure a way out of this, here is the solution
Which image and Description does Facebook pick from your Post Page
Facebook regularly scrapes your page and caches the data to their servers. They look for meta data information(OpenGraph tags and others) in your post page. The meta data can explicitly specify the image and the description to use when the page is shared.If Facebook doesn’t find any meta data, then their algorithms will fetch some description and image from your Page. Facebook shows a wrong description or image when their Algorithms are not able to fetch the correct image and description from your Post Page. We will solve both of these issues using two different techniques.1. Fixing the Wrong Image Problem.
You might have noticed that comment avatars, and other irrelevant images from your sidebars come up when you share the post on Facebook . The solution to this is to specify the image in the page meta data. We will be using open graph tags for the same. Go to Template > Edit HTML and just above</head>Paste the following code snippet.
<b:if cond='data:blog.postImageUrl'> <meta expr:content='"" + data:blog.postImageUrl' property='og:image'/> <b:else/> <meta content='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinQSoPOWe4N4ZkABtgfBSQvGbBmCMtoX2EuDORVoLvbgQrv9bS8QNW1bOG8qz1DD7HKg2jFhHP81HW9Eu5S8Srw4j9zwC8qaR_Fmv7xoPpROwbKzPNOwVEWYJjo5OwNEAwvxU9belYTW4/s200-c/default.png' property='og:image'/> </b:if>You can alter the image URL in the above snippet. That image will be used when no images are present in the blog post. Now when you share posts to Facebook, the first image in your post should show up on Facebook as a thumbnail. If the post doesn’t have images, then the fall back image which we have specified in the snippet will be used. If you don’t see results right away , then it might be due to the caching done by Facebook(Facebook caches the metadata). You can force Facebook to update the cache by debugging the post URL using this tool and selecting the “Fetch new scrape information” option. If you want to make sure that the thumbnail shows up correctly, the first image in your post should be atleast 200 x 200 px in size(that’s the minimum size which Facebook expects). If the first image is smaller, then Facebook might ignore the OpenGraph tags and use it’s own algorithms to find the post image.
0 comments:
Post a Comment