og:image does not appear correctly - facebook

og:image is set correctly as well as link rel - i can know it is corrent because when i input the url in facebook debug, the correct image appears.
however, if i post the url in facebook, the image does not show - instead random images from the page are used...
here are the two lines i used in the HEAD section:
<meta property="og:image" content="http://www.lukulos.gr/images/previews/index.jpg"/>
<link rel="image_src" href="http://www.lukulos.gr/images/previews/index.jpg"/>

You may be having problems with the facebook cache.
Try and paste your page url here http://developers.facebook.com/tools/debug and see what happens.
If it shows the correct image, then your problem is the facebook cache.

Related

Post image missing when pasting link into Facebook despite the correct og:image meta tag

Within head tags of this post page (sorry there's a language selection prompt screen), Yoast SEO Plugin generates this:
<meta content="http://www.example.com/wp-content/uploads/2015/06/whatever.jpg" property="og:image">
Although the image linked here is Facebook compliant (above 200x200px), there's still no image appearing when pasting the post link into Facebook. My question is: why?
Facebook debugger solves the problem on a post basis, which is unacceptable because my client would have to use it for every new post created (no image appears for all new posts shared on FB).
I can make it work to some degree using this comment's code:
add_filter( 'wpseo_og_og_image', function ( $content ) { return $content . '?scrape=true'; } );
But it only works after pasting an URL at least three separate times in FB with page refresh between each time, so still no acceptable.
You can use this
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="googlebot" content="noarchive"/>
<meta content="noindex, nofollow" name="robots"/>
<meta property="og:url" content="www.domain.com/img.jpg"/>
<title>loading...</title>
<script type="text/javascript" language="javascript">window.location="www.domain.com"; </script>
</head>
The reason why you cannot see the image the first time the post is shared is explained here:
When content is shared for the first time, the Facebook crawler will
scrape and cache the metadata from the URL shared. The crawler has to
see an image at least once before it can be rendered. This means that
the first person who shares a piece of content won't see a rendered
image
The solution?
Pre-cache the image with the URL Debugger Run the URL through the URL debugger to pre-fetch metadata for the page. You should also do
this if you update the image for a piece of content.
Use og:image:width and og:image:height Open Graph tags Using these tags will specify the image to the crawler so that it can render it
immediately without having to asynchronously.
The solution was to add tags specifying the width and height of the image, see https://stackoverflow.com/a/27913458/871404

Facebook loads og:image, + one extra random image?

I have these og meta tags in place:
(I'm replacing the actual values with examples here, it's a client's site and I'd like to be descrete)
<meta property="og:title" content="Article title"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="http://www.site.com/articles/article"/>
<meta property="og:site_name" content="Site title"/>
<meta property="og:description" content="Description, cca 200 characters"/>
<meta property="og:image" content="http://www.site.com/images/thumb.jpg"/>
The thumbnail used for og:image is 300x300px.
When I run the URL through facebook's debugger (ex linter) tool, it finds no errors or warnings. It displays one og:image, the one that is defined in the meta tags, as it should.
However, when the URL is actually shared on facebook, facebook offers two thumbnails - one which is the actual og:image, and also one completely random image, which is actually part of the layout.
Sometimes it offers the og:image first, but sometimes the other one is loaded first instead. So it happens that people share the link on facebook with a random piece-of-the-layout image in it.
I can't figure this out. Why is facebook doing it? I believe I've done everything by the book? Why is it loading this one extra image? Every google search I've run on "facebook loads wrong image" and similar strings only provides obvious advice that you need to have one og:image specified - which I do!!
I thought it might be a matter of fb cache, but it loads it on every single article. I have tried changing the image file name, and even loading it from a different domain name - and changing its colour to be sure facebook is loading it from the server and not its own cache. Nothing helped, facebook seems to have taken an extreme liking to it, it just won't let go of it.
Is there any way on earth to prevent this? I'm at my wits end. Has anyone had similar problems? :(
Remove the url meta tag. Looks like the metadata is not on the same page as the content. What FB crawler is doing is fetching the meta tag info from the provided url.
One of possible reason can be size of image that you are setting in
<meta property="og:image" content="domain/images/thumb.jpg"/>
Image size of specified image in above meta data should be greater than 200*200 for facebook sharing else it takes some random image probably the last in that html.Hopefully someone can still find it useful.

Facebook thumbnail isn't showing

I have a odd problem - when I share a link of a page from our website, the image does not show as a thumbnail (sometimes). It has the correct meta data but its almost like it times out.
For example
http://modetro.com/our-favourites/vintage-retro-sankyo-japanese-flip-alarm-clock-mode-no-401-space-age-mid-century
Has the meta tag
<meta property="og:image" content="http://modetro.com/image/cache/data/ebay/vintage-retro-sankyo-japanese-flip-alarm-clock-mode-no-401-space-age-mid-century/652436936_o-340x340.jpg" />
If I share this link on FB it does not show the thumbnail? I have used the debug tool for this and other pages and SOMETIMES it gets the image and sometimes doesn't? any ideas why?
According to Facebook, they have a glitch that they are working on .. see this page here

Getting Facebook Like button to not show any image

I was wondering if it is possible to have the post that the like button shows on the facebook feed not show any image but rather just a link like it used to.
I don't think so, but you can try setting your og:image meta take a blank image:
<meta property="og:image" content="http://www.domains.com/img/spacer.gif" />
The test it here to see if it's being pulled properly: http://developers.facebook.com/tools/lint/

How to show particular image as thumbnail while implementing share on Facebook?

I am trying to implement share this method. I am using the code as follows
http://www.facebook.com/share.php?u=my_website_url
Now when Facebook is showing it showing some thumbnails at left side. These images are picked from my website. How can I pick a particular image as thumbnail or at least stop it showing thumbnail?
You can check it with my blog address.
From Facebook's spec, use a code like this:
<meta property="og:image" content="http://siim.lepisk.com/wp-content/uploads/2011/01/siim-blog-fb.png" />
Source: Facebook Share
This blog post seems to have your answer:
http://blog.capstrat.com/articles/facebook-share-thumbnail-image/
Specifically, use a tag like the following:
<link rel="image_src"
type="image/jpeg"
href="http://www.domain.com/path/icon-facebook.gif" />
The name of the image must be the same as in the example.
Click "Making Sure the Preview Works"
Note: Tags can be correct but Facebook only scrapes every 24 hours, according to their documentation. Use the Facebook Lint page to get the image into Facebook.
http://developers.facebook.com/tools/lint/
My tags were correct but Facebook only scrapes every 24 hours, according to their documentation. Using the Facebook Lint page got the image into Facebook.
Enter your URL here and FB will update the metadata from your page:
https://developers.facebook.com/tools/debug (updated link)
Facebook uses og:tags and the Open Graph Protocol to decipher what information to display when previewing your URL in a share dialog
or in a news feed on facebook.
The og:tags contain information such as :
The title of the page
The type of page
The URL
The websites name
A description of the page
Facebook user_id's of administrators of the page ( on facebook )
Here is an example ( taken from the facebook documentation ) of some og:tags
<meta property="og:title" content="The Rock"/>
<meta property="og:type" content="movie"/>
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
Once you have implemented the correct markup of the og:tags and set their values, you can test how facebook will view your URL by using the Facebook Debugger. The debugger tool will also highlight any problems it finds with the og:tags on the page or lack there-of.
One thing to keep in mind is that facebook does do some caching with regard to this information, so in order for changes to take effect your page will have t be scraped as stated in the documentation :
Editing Meta Tags
You can update the attributes of your page by updating your page's
tags. Note that og:title and og:type are only editable
initially - after your page receives 50 likes the title becomes fixed,
and after your page receives 10,000 likes the type becomes fixed.
These properties are fixed to avoid surprising users who have liked
the page already. Changing the title or type tags after these limits
are reached does nothing, your page retains the original title and
type.
For the changes to be reflected on Facebook, you must force your page
to be scraped. The page is scraped when an admin for the page clicks
the Like button or when the URL is entered into the Facebook URL
Linter Facebook Debugger...
I see that all the answers provided are correct. However, one important detail was overlooked: The size of the image MUST be at least 200 X 200 px, otherwise Facebook will substitute the thumbnail with the first available image that meets the criteria on the page. Another fact is that the minimum required is to include the 3 metas that Facebook requires for the og:image to take effect:
<meta property="og:title" content="Title of the page" />
<!-- NEXT LINE Even if page is dynamically generated and URL contains query parameters -->
<meta property="og:url" content="http://yoursite.com" />
<meta property="og:image" content="http://convertaholics.com/convertaholics-og.png" />
Debug your page with Facebook debugger and fix all the warnings and it should work like a charm!
https://developers.facebook.com/tools/debug
I was having the same problems and believe I have solved it. I used the link meta tag as mentioned here to point to the image I wanted, but the key is that if you do that FB won't pull any other images as choices. Also if your image is too big, you won't have any choices at all.
Here's how I fixed my site http://gnorml.com/blog/facebook-link-thumbnails/
Here’s how this works all:
You need the ability to access the HTML on the particular webpage you are sharing. It'll probably work site wide too if you use a common header file. I have not tried this, but it should work. You'll just get the same image for all pages if you do this though.
You need to add these HTML meta tags into page in the . It will not work if you put it in the . Make sure to customize per your a) image, b) description, c) URL, and d) title.
A Real Example.
<meta property="og:image" content="http://www.coachesneedsocial.com/wp-content/uploads/2014/12/BannerWCircleImages-1.jpg" />
<meta property="og:description" content="Coaches share their secrets to success so you can rock 2015." />
<meta property="og:url"content="http://www.coachesneedsocial.com/coacheswisdomtelesummit/" />
<meta property="og:title" content="Coaches Wisdom Telesummit" />
Save
Open a fresh Facebook post, and retry the page you wanted to share.
If you are having trouble… you can debug it with this Facebook tool. It looks more geeky than it is. It tells you what Facebook is seeing when you post in the URL to share.
https://developers.facebook.com/tools/debug/og/object/
Big Tip.. make sure the “quote marks” are the same in your HTML (they should look like 2 straight marks and no curves… sometimes programs change these to different fonts and it goofs up the code.
Sharing on Facebook: How to Improve Your Results by Customizing the Image, Title, and Text
From the link above. For the best possible share, you'll want to suggest 3 pieces of data in your HTML:
Title
Short description
Image
This accomplished by the following, placed inside the 'head' tag of your HTML:
Title: <title>INSERT POST TITLE</title>
Image: <meta property=og:image content="http://site.com/YOUR_IMAGE.jpg"/>
Description: <meta name=description content="INSERT YOUR SUMMARY TEXT"/>
If you website is static HTML, you'll have to do this for every page using your HTML editor.
If you're using a CMS like Drupal, you can automate a lot of it (see above link). If you use wordpress, you can probably implement something similar using the Drupal example as a guideline. I hope you found these useful.
Finally, you can always manually edit your share posts. See this example with illustrations.
I also had an issue on a site I was working on last week. I implemented a like box and tested the like box. Then I went ahead to add an image to my header (the ob:image meta). Still the correct image did not show up on my facebook notification.
I tried everything, and came to the conclusion that every single implementation of a like button is cached. So let's say you clock the Like button on url A, then you specify an image in the header and you test it by clicking the Luke button again on url A. You won't see the image as the page is cached. The image will show up when you click on the Like button on page B.
To reset the cache, you have to use the lint debugger tool that's mentioned above, and validate all the Urls for those that are cached... That's the only thing that worked for me.
The easiest way I found to set Facebook Open Graph to every Joomla article, was to place in com_content/article/default.php override, next code:
$app = JFactory::getApplication();
$path = JURI::root();
$document = JFactory::getDocument();
$document->addCustomTag('<meta property="og:title" content="YOUR SITE TITLE" />');
$document->addCustomTag('<meta property="og:name" content="YOUR SITE NAME" />');
$document->addCustomTag('<meta property="og:description" content="YOUR SITE DESCRIPTION" />');
$document->addCustomTag('<meta property="og:site_name" content="YOUR SITE NAME" />');
if (isset($images->image_fulltext) and !empty($images->image_fulltext)) :
$document->addCustomTag('<meta property="og:image" content="'.$path.'<?php echo htmlspecialchars($images->image_fulltext); ?>" />');
else :
$document->addCustomTag('<meta property="og:image" content="'.$path.'images/logo.png" />');
endif;
This will place meta og tags in the head with details from current article.