41

It was already working, but today I was surprized, when I tryed to share the link, and Facebook did not show the image, from og:image meta tag.

from facebook debugger:

Meta Tag:   <meta property="og:description" content="Профессиональная сеть вопросов и ответов,создаваемая и управляемая сообществом пользователей. Ресурс для тех, кто хочет знать ответы на все вопросы." />
Meta Tag:   <meta property="og:title" content="Закрытое экспертное сообщество OdinOtvet" />
Meta Tag:   <meta property="og:type" content="website" />
Meta Tag:   <meta property="og:image" content="http://www.odinotvet.ru/images/logo_250.png" />
Meta Tag:   <meta property="og:url" content="http://www.odinotvet.ru" />
Meta Tag:   <meta property="og:site_name" content="ОдинОтвет" />
Meta Tag:   <meta property="fb:app_id" content="286967601317982" />
Meta Tag:   <meta property="fb:admins" content="100002890978393,100001666575542" />

enter image description here

Where is the image?

Alexei
  • 1,289
  • 3
  • 19
  • 34

10 Answers10

27

The image is appearing in the Facebook debugger (although it doesn't look great since you've got some transparency which works best with your grey background which FB won't take)

Also its best to use a square image.

One thing I've found it that Facebook caches the meta data on their side. So if we do changes to things like images, they don't always surface until that cache is cleared. Perhaps you had the wrong image url/no url in the past and FB has cached that result. If so you may have to wait a while for it to clear and get your data again. I've seen it take a while (in the approx range of a day)

Bruce Lowe
  • 6,063
  • 1
  • 36
  • 47
  • 1
    changing from png to gif solved the problem, and the old png was not cached by FB, so I sow results immediately after applying and testing with FB debugger – Alexei May 14 '12 at 05:39
  • 7
    Sticking your URL through the Facebook debugger forces a cache refresh - something to bear in mind if you're impatient! – DaveStephens Oct 09 '12 at 01:36
  • 5
    Even that does not refresh the cache all the times – C graphics Apr 08 '13 at 03:22
  • 1
    On [this answer](http://stackoverflow.com/questions/17982183/facebook-fb-ui-send-dialog-intermittently-returns-invalid-link-error/18055274#18055274) I give links to the documentation specifying why to scrape a page and how (by sending a web request to the Facebook Object Debugger or by using curl). This process should be done for each newly created page. – glautrou Aug 13 '13 at 09:11
  • 1
    Old answer, new comment. Actually it seems best to use 1.91:1 images nowadays. https://developers.facebook.com/docs/sharing/best-practices#images – biko Mar 16 '16 at 08:14
17

Turns out the answer is to also set og:image:width and og:image:height.

See also: Facebook Open Graph No Image First Time

(In my own testing, I found that setting og:image:width and og:image:height is sufficient. Setting og:image:type is unnecessary.)

Community
  • 1
  • 1
asadovsky
  • 559
  • 5
  • 5
  • This answer worked for me. In order to get Facebook to recache my site and apply the change I had to use `https://developers.facebook.com/tools/debug/sharing/?q=myURL.TLD` – Altimus Prime Dec 21 '19 at 04:04
6

I had the same problem but FB Debugger "said" that the image has to be at least 200px in both dimensions. When I resized the image to 200px by the shorter side all went well. Another thing is the thing Bruce said - the caching. I had to start another page to test my final link.

Hope this helps. Regards

  • 1
    Interestingly facebook ignores the 144x144 png I have in the og:image in favour of the loading spinner.gif that is 16x16 or so. Amusing. Will try 200x200 png, but I bet it just wants .gif, or perhaps the 8-bit transparency on the png is confusing it? – Matt Parkins May 08 '13 at 16:23
4

When you notice a cache problem with a page you want to share on facebook (I mean if you see differents values between your page source code and the values that appear on facebook, or if you notice some missing values), then you can go on the following url https://developers.facebook.com/tools/debug/, give the url you were trying to share on facebook and submit the form to clear the facebook cache. You can now try again to share your page, you should see the same values than in your page source code.

MacSim
  • 374
  • 3
  • 10
  • It seems that the cache is actually cleared. However it seems that facebook does not like small images. If og image is too small a image is "randomly" taken. – progzy Dec 12 '14 at 14:18
3

Put your URL into this site and facebook will help you out:

http://developers.facebook.com/tools/debug

Some time facebook showing old caches images files so above URL your will so current updated result. once done facebook will store your new image on after that it will show only new images.

Shiv Singh
  • 6,939
  • 3
  • 40
  • 50
0

For manual cache emptying, add ?v=2 or some arguments to your url, then click on "add a new url" and launch the Facebook debugger (https://developers.facebook.com/tools/debug/). Now, retry with the original url (without ?v=2), and the image appear.

user3768981
  • 91
  • 1
  • 9
0

I only managed to resolve it when I placed my id from my previously created application

<meta property = "fb:app_id" content = "1234567891011121" />
Karra Max
  • 112
  • 2
  • 9
0

I came across another reason for og images not being downloaded by FB which had to do with the EXIF metadata not being writent to the uploaded images on the WordPress site. I have written a detailed answer about this issue in this thread.

Aurovrata
  • 2,000
  • 27
  • 45
-2

The answer is, you have to remember to make the image open access. If you upload it to your server, and your server have security activated. (Security means you can't acces images or anything without knowing the exact link to it). If that is activated facebook can't connect to your image.

A thing you can do, is upload your image to dropbox and make that file public. So everyone has access to it and then link it to that :). Or just open up your server access. ^^ :)

-3

Try this it will help

<?php

$params = array();
if(count($_GET) > 0) {
    $params = $_GET;
} else {
    $params = $_POST;
}
// defaults
if($params['type'] == "") $params['type'] = "restaurant";
if($params['locale'] == "") $params['locale'] = "en_US";
if($params['title'] == "") $params['title'] = "default title";
if($params['image'] == "") $params['image'] = "thumb";
if($params['description'] == "") $params['description'] = "default description";

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# MY_APP_NAME_SPACE: http://ogp.me/ns/fb/MY_APP_NAME_SPACE#">
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

        <!-- Open Graph meta tags -->
        <meta property="fb:app_id" content="MY_APP_ID" />
        <meta property="og:site_name" content="meta site name"/>
        <meta property="og:url" content="URL/index.php?type=<?php echo $params['type']; ?>&locale=<?php echo $params['locale']; ?>&title=<?php echo $params['title']; ?>&image=<?php echo $params['image']; ?>&description=<?php echo $params['description']; ?>"/>
        <meta property="og:type" content="MY_APP_NAME_SPACE:<?php echo $params['type']; ?>"/>
        <meta property="og:locale" content="<?php echo $params['locale']; ?>"/>
        <meta property="og:title" content="<?php echo $params['title']; ?>"/>
        <meta property="og:image" content="URL/img/<?php echo $params['image']; ?>.png"/>
        <meta property="og:description" content="<?php echo $params['description']; ?>"/>

    </head>
</html>
Sita
  • 15
  • 1