Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook share doesn't show images

I code a news PHP script. End of each news I have a Facebook share button. The problem is I can't display thumbnail images with Facebook share.

I tried Meta OG

<link rel="image_src" href="" /> 

element without any success. Interesting thing is, some of the domains which is using my news PHP Script, has no problem with it but some has.

Domain without any problems:

  • http://www.yenialanya.com/manset/vergi-denetmenine-itiraz.htm (please check the bottom of the news)

Domains with problems:

  • http://www.usakhabermerkezi.com/egitim-ogretim/usak-universitesi-rektorluk-secimleri-sonuclandi-iste-secim-sonuclari.htm
  • http://www.demokrathaber.net/dunya/dunyanin-ekseni-kaydi.htm
  • http://www.tebilisim.com/v4/siyaset/benzin-zamlardan-bizde-hosnut-degiliz.htm

I also tried addThis and it didn't solve the problem.

All of the domain names above are using the same system. I thought it might be because of the system so I tried clean HTML page:

  • http://www.phpsistem.com/fb/

As you can see in the last example, I used 2 different kind of sharing options. First with popup. I sent all parameters over URL but some domains display images, some don't. I also added addThis option.

I also thought about .htaccess and cleaned everything in it since I thought .htaccess might block something. I took every step very carefully which I could think of.

This issue started to be annoying, I would be glad if anyone could help me out.

like image 472
Revenant Avatar asked Apr 17 '11 15:04

Revenant


People also ask

Why are Facebook images not showing?

If you can't see photos on Facebook and you're seeing black boxes, empty boxes or broken images instead: Check if you have images turned on in your Facebook data usage settings. Check if you have images enabled in your phone's mobile web browser settings.

How do I fix my share settings on Facebook?

Tap in the top right of Facebook. Scroll down and tap Settings. Scroll down to Audience and visibility section and tap the option you want to change the privacy for. For other things you share on Facebook, you can select the audience before you share.

Why can't I share uploaded photos on Facebook?

Check the Size and Format of Your Photo Also, make sure your photo is in one of the following file formats: BMP, GIF, IFF,PSD, TIF, WEBP, WBMP, PNG, JPG and JPEG. Also, you can try toggling an option in the Facebook app to see if that helps fix the can't upload pictures to Facebook problem.


2 Answers

Use Open Graph protocol

<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"/>
<meta property="og:site_name" content="IMDb"/>
<meta property="fb:admins" content="USER_ID"/>
<meta property="og:description"
      content="A group of U.S. Marines, under command of
               a renegade general, take over Alcatraz and
               threaten San Francisco Bay with biological
               weapons."/>

To test each links use URL Linter


Look at this forum, most of them will ask same questions, why OG image is not working on like button. It's a bug maybe? Bug 16580

like image 79
haha Avatar answered Oct 04 '22 01:10

haha


Are you using a public server or a local one? Facebook share doesn't show pictures if the URLs are coming from localhost.

like image 32
Naveed Ahmad Avatar answered Oct 04 '22 01:10

Naveed Ahmad