0

I'm making a Facebook sharer with FB UI. I have og tag:

<meta property="og:image" content="https://www.mydomain.fi/img/fb-share-img.jpg" />

The image is 1200 × 627. The og debugger doesn't give any errors. However, when sharing the link, share image appears to be small square instead of full width image.

What might cause this?

The weird thing is that earlier og was fetching the data right and showed the photo bigger. I had to debug something and fetch the site again and now I can't get the big image back.

Jaakko Karhu
  • 2,298
  • 4
  • 28
  • 41

1 Answers1

1

I, too, had all the right og: tags and a large share image. When sharing the url directly, I got a large image. When sharing from the Facebook JS SDK, it started out as large, then suddenly got small. As others have pointed out, this is almost a random selection based on FB algorithms. Having spent many hours fighting with tags and the debug tool, I accidentally stumbled upon a hack (use at own risk):

Without knowing it, I copy-pasted an og:type tag from another website which contained an invalid character (in my case the quotation marks were "printer's quotes")

meta property="og:type" content=”website” (see the difference between the quotes around "og:type" and "website"?)

To my stunned disbelief, while this caused on error in the debug tool ("Object at URL '[myurl]' is invalid because the configured 'og:type' of '”website”/' is invalid.") it actually forced the large image to be used, and all other meta data was fine.

I have no idea how or why, so don't ask. But it worked. All the time. And I hope this helps some other developers out there until we can be assured of the correct size image being shown. As I said, your mileage may vary, and don't blame me if you break it :)

  • Well that's weird. I give it a shot with some of my ongoing projects. I can maybe accept your answer then. And, of course, I will blame you if I break it. :) @DominicLee – Jaakko Karhu Mar 18 '15 at 19:36