cjgammon

Facebook Share url Metadata Parameters

[Edit 4-29-13]: It has come to my attention that facebook has updated their documentation to include this which can be found in it’s most recent incarnation here.

So in the glorious void and mess that is the facebook documentation, nowhere does it discuss the details on the share url and the optional parameters that you can pass to customize the images title and more.

http://www.facebook.com/sharer/sharer.php?s=100&p%5Btitle%5D=titlehere&p%5Burl%5D=http%3A%2F%2Fwww.yoururlhere.com&p%5Bsummary%5D=yoursummaryhere&p%5Bimages%5D%5B0%5D=https://www.google.com/images/srpr/logo3w.png

will display the following info:
Title: titlehere
Summary: yoursummaryhere
URL: http://www.yoururlhere.com
Image:

Tags: ,

19 Responses to “Facebook Share url Metadata Parameters”

  1. Mark Beaty says:

    Wish there was a mobile version of this URL. This URL serves a very mobile-unfriendly web page. They have a m.facebook.com/sharer.php URL, but I believe it depends on pulling some tags out of the page at the URL you provide in the u parameter. I could never get it to produce anything close to attractive. I resorted to the Facebook feed dialog URL with the &display=touch parameter to serve a mobile friendly page. See https://developers.facebook.com/docs/reference/dialogs/feed/

  2. hesham says:

    thanks

  3. Dom says:

    Dude… this helped a ton. You are the only source for this information on the internet. Thanks.

  4. Chris stumph says:

    Thanks so much! Can’t believe this can’t be found in the docs. Very frustrating.

  5. Pagu says:

    The only problem by using it is i cannot share content on pages i create . it creates troubles in sharing them .. Please help

  6. cjgammon says:

    What kind of content are you trying to share? The share URL is intended to share links to a page, you could use a # to link to a specific part of a page.

  7. Nils says:

    Thank you much for this! The other places I looked for this only had an outdated URL that only allowed URL sharing. This is exactly what I needed. Thanks!

  8. ronald says:

    Thumbnails not showing

  9. Lukas says:

    Hi,
    and how would the mobil version of this url look like? Somebody has an example?

    Thank you guys

  10. Mario says:

    The custom metadata worked great…thanks a bunch

  11. jignesh says:

    I am not getting thumbnail image

  12. cjgammon says:

    Those having problems with thumbnails, the example uses a url that has no image as it’s only an example of how to use your URL. The following url uses the google logo as a thumbnail, which I’ve tested and seems to work if you put this url in a browser. “http://www.facebook.com/sharer/sharer.php?s=100&p%5Btitle%5D=titlehere&p%5Burl%5D=http%3A%2F%2Fwww.yoururlhere.com&p%5Bsummary%5D=yoursummaryhere&p%5Bimages%5D%5B0%5D=https://www.google.com/images/srpr/logo3w.png”

  13. Amit says:

    Hello
    In your code share is working but still i am facing the thumbnail problem . thumb image is not displaying .
    so please if you any idea about thumb related then update me

    Thanks and Regards
    Amit kumar

  14. deelirium says:

    To make the thumbnail work you might have to encode the url, too.

    ie

    https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo3w.png

    instead of

    https://www.google.com/images/srpr/logo3w.png

  15. Katsura says:

    Encoded / Decoded neither make the thumbnail work. I had a code that works with the thumbnail just last week. However, just tested it this day and it doesn’t show up anymore. Maybe there is a possibility that facebook has slightly updated this function?

  16. zambadu says:

    Thumbnail works good for me in encoded format.

  17. Joel R. says:

    There is an official documented way to do this:

    Facebook Feed Dialog:

    https://developers.facebook.com/docs/reference/dialogs/feed/

  18. Kathleen says:

    Interesting. I am having the same thumbnail problem. If I use the link cjgammon posted in the comment above, I get the google image. But if I substitute a domain and path on my server, I don’t get the image. If I copy and paste my image url in the browser, the image does exist, and I am replacing / for %2F (tried it both ways, actually).

    Inspecting the element, the first time I run it (with the google image) I get a div with a class of “UIShareStage_Image”. When I resubmit using my image, I get a class of “UIShareStage_NoImage”.

    So frustrating!

  19. Jeremy says:

    Can I add a callback url so I know that somebody shared my link and to who?

Leave a Reply