7

I'm trying to add an image to page share via https://developers.facebook.com/docs/plugins/share-button/ However, I can't seem to find how can I add an image to the facebook share post

Eliezer Broide
  • 95
  • 1
  • 1
  • 7
  • 2
    Facebook uses open-graph meta tags to decide, which images it shows in the dialog: http://stackoverflow.com/questions/1138460/how-does-facebook-sharer-select-images – mrksbnch Nov 18 '13 at 11:55

2 Answers2

15

As rightly commented by demrks, Facebook uses open graph meta tags.

For your specific problem, you can use the og:image meta tag,

<meta name='og:image' content='path'>

Replace path with the path to where your image is.

You can check how your url appears on the timeline by using the Facebook url debugger.

Ranveer
  • 6,683
  • 8
  • 45
  • 92
4

The Nov 18, 2013 answer is deprecated. The current answer according to https://developers.facebook.com/docs/sharing/webmasters/

<meta property="og:image" content="http://static01.nyt.com/bookJumbo-v2.jpg" />
ubershmekel
  • 11,864
  • 10
  • 72
  • 89