27

Since July 17 the old share button stopped working on all the websites I manage.

I've read reports by other users that are facing similar issues, but I was not able to find anything official.

Do you know if there is any official source available for this?

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Scalax
  • 430
  • 1
  • 5
  • 12
  • On our sites all the old share buttons do still work. – borisdiakur Jul 18 '12 at 10:05
  • Can you give me an example? Or at least the code you are using? – Scalax Jul 18 '12 at 10:07
  • 2
    Click here: https://www.facebook.com/sharer/sharer.php?u=www.spiegel.de&t=FOOBAR – borisdiakur Jul 18 '12 at 10:08
  • I see. Well this is achiveable with a link that sends you directly to the old sharer.php while passing the url to share as a parameter; the problem is that with this solution you cannot load the share numbers on the page on the side of the button and that the share window doesn't close after the use clicks on the publish button – Scalax Jul 18 '12 at 10:13
  • You can post the code you are using, so that the community can help solve your problem. – borisdiakur Jul 18 '12 at 10:17
  • The code i'm using is this one: – Scalax Jul 18 '12 at 10:33
  • I'm using http:// before the jscript url; it got cutted by the stackoverflow comment system – Scalax Jul 18 '12 at 10:50
  • Same applies for `href="https://facebook.com/sharer.php"` Please check this one too. – borisdiakur Jul 18 '12 at 11:05
  • You are right, this one does not seem to work anymore. – borisdiakur Jul 18 '12 at 11:16
  • I would suggest you mark @SeanKinsey 's answer as the correct one, since it actually is the official source you were looking for (you can click on the check mark on the left of his answer). – borisdiakur Jul 18 '12 at 21:04
  • Here's the documentation for new url which is not deprecated and has exactly same syntax: https://developers.facebook.com/docs/reference/plugins/share-links/ – dsomnus May 07 '13 at 19:59

7 Answers7

25

Update: As of May 2020, the Facebook documentation doesn't explicitly mention support for /sharer.php URLs, but the snippets generated by Share Button page still refer to that path.


Some time has past since this first was asked but some new information from the Facebook documentation has given us the possibility to see some official "proof" that the sharer.php method of sharing links still works, is still supported and is alive and kicking.

The reference is this page of the documentation and a few examples are also given:

This is what the simplest use of the share dialog looks like:

<a href="https://www.facebook.com/sharer/sharer.php?u=example.org" target="_blank">
  Share on Facebook
</a>

And also:

You can point to this URL in a new window or a popup. If you use JavaScript to pop open a new window, you can also refer to the URL of the current page being shared as location.href. That gives you code you can use on all pages:

var sharer = "https://www.facebook.com/sharer/sharer.php?u=";
window.open(sharer + location.href, 'sharer', 'width=626,height=436');

To summarize, there was indeed a period of time when the behavior of the sharer.php was unpredictable. It was widely accepted that the method had been deprecated and that it was not wise to use it. This has now officially been busted as an example usage of sharer.php was added to Facebook's documentation.

cubuspl42
  • 7,833
  • 4
  • 41
  • 65
Lix
  • 47,311
  • 12
  • 103
  • 131
15

UPDATE #3 (June 2016):

It's gone again: There are no more references to the sharer.php in the documentation. Though you have the option to use the share dialog without integrating with the facebook sdk in any form. An important difference is the required app_id parameter. Here is one example from the docs:

<a id="facebook" href="https://www.facebook.com/dialog/share?app_id=145634995501895&display=popup&href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F&redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fexplorer" target="_blank">share me</a>

UPDATE #2:

See @Lix's answer.


UPDATE #1:

As Sean pointed out (for this credit to him) you can use the FBML version of the share button. A code snippet for the FBML version:

<!DOCTYPE html>
<html xmlns:fb="http://ogp.me/ns/fb#" lang="en" style="overflow:hidden;">
    <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
        <meta charset="utf-8">
        <title>Test</title>
    </head>
    <body>
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) return;
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=YOUR_APP_ID"; // appId must be valid
          fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        <fb:share-button type="button_count" href="http://www.foobar.com">
        </fb:share-button>
    </body>
</html>

NOTE: This version of the share button (like all current social plugins by Facebook) creates a cookie with the datr parameter which is a potential threat to user privacy. You should keep this in mind if you must follow privacy policies.

A code snippet for the sharer.php version:

<a id="fb-share" style='text-decoration:none;' type="icon_link" onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=foo&amp;p[summary]=bar&amp;p[url]=https://www.foobar.com/&amp;p[images][0]=https://www.foobar.com/thumb.gif','sharer','toolbar=0,status=0,width=580,height=325');" href="javascript: void(0)">
    <img src="img/share.gif" width="62" height="18" alt="Share"/>
</a>



ORIGINAL ANSWER:

The Share Button has been deprecated already a while ago. It might be dead completely now, or just temporarily, only Facebook knows. Officially it is deprecated.

From the documentation:

What happened to the old Share button?

We deprecated the Share Button when we launched the Like button [...]

borisdiakur
  • 10,387
  • 7
  • 68
  • 100
  • 1
    Since it suddently stopped working at all and it was still in use on thousands of websites i would have expected an official announcement for this. However, it can also be a malfunction introduced with the latest build, who knows? – Scalax Jul 18 '12 at 10:05
  • It is the same button rendered, so no difference in cookies set. Note, it was not the Share Button that we dropped support for here, it was the previous version of the SDK (connect.php/featureloader.js.php). Do yourself a favor of upgrading. – Sean Kinsey Jul 18 '12 at 20:25
  • 1
    @SeanKinsey Thanks Sean! My point is: If privacy policies do not agree with the cookie set (no matter which SDK), I would recommend to use the sharer.php . It does not have a counter but people will still be able to share. If the customer does not have any privacy concerns, I'll be the first to upgrade, promise : ] – borisdiakur Jul 18 '12 at 20:55
  • Thanks Lego, Thanks Sean! By upgrading to the it worked! – Scalax Jul 25 '12 at 12:46
  • @Lego the share button make a strange behavior, it rendered in an iframe with both 1000px width and height which leads to render in incorrect place and may destroys pages usability on some devices something like the following question of mine: http://stackoverflow.com/questions/14364323/facebook-share-button-is-rendered-incorrectly – SaidbakR Jan 17 '13 at 17:28
  • I don't understand ... the old sharer.php allowed customization of image, title, description ... but this new like button does not appear to allow customization. I presume it ties in directly to the page's meta:og tags. But that does not allow per-button customization. – dsdsdsdsd Apr 02 '13 at 09:41
  • 1
    @dsdsdsdsd If you need per-button customization I would suggest to use the [Feed Dialog](https://developers.facebook.com/docs/reference/dialogs/feed/). – borisdiakur Apr 02 '13 at 11:56
  • I would consider feed dialog to be an even better answer. ... ...the only caveat to that might be that the feed dialog requires an app id ... which maybe that is fair: why would I want to allow anybody to post stuff on my webpage without knowing who they are – dsdsdsdsd Apr 02 '13 at 12:20
7

The code used here,

<a name="fb_share" type="button_count" share_url="..." href="facebook.com/sharer.php" rel="nofollow">Share</a>

<script src="static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

was deprecated several years ago, and Facebook switched to serving the new JS SDK in its place on Monday.

The official version of the share button is to use the JS SDK and to use

<fb:share ..... />

That said, we are now serving the new SDK in it's place, and I plan on bringing the old <a name="fb_share" ... tag back to life today :) Sorry about this.

But maybe time to update to the new SDK?

sakibmoon
  • 2,026
  • 3
  • 22
  • 32
Sean Kinsey
  • 37,689
  • 7
  • 52
  • 71
5

So to sum this up, it still works if you do this :

<a target="_blank" style='text-decoration:none;' type="icon_link" href="http://www.facebook.com/sharer.php?u=URL-TO-SHARE-HERE"><img style="width:26px;height:26px;" src=".../facebook2.png"%>"/></a>

It will open the share popup that will close itself once published.

But everyone should move asap to the new "like" and "send" buttons...

sakibmoon
  • 2,026
  • 3
  • 22
  • 32
Michel
  • 265
  • 1
  • 8
3

I think this seems to be a good future-safe compromise, as taken from the fb docs:

Direct URL Example

You can also bring up a Feed Dialog by explicitly directing people to the /dialog/feed endpoint:

https://www.facebook.com/dialog/feed? app_id=458358780877780&
link=https://developers.facebook.com/docs/reference/dialogs/&
picture=http://fbrell.com/f8.jpg& name=Facebook%20Dialogs&
caption=Reference%20Documentation&
description=Using%20Dialogs%20to%20interact%20with%20users.&
redirect_uri=https://mighty-lowlands-6381.herokuapp.com/

You DO have to make an app to get an app ID to use in this method, but you DON'T have to get permission from the user before prompting them to post, and you can use any image you like.

J Griffiths
  • 701
  • 6
  • 14
1

On 18 July Facebook released an update - all posts made to the page via external application now get a Share button. Previously people used a couple of hacks to add Share button themselves (using sharer.php) but this should be removed now as all posts made via an application automatically get a Share button.

Master Drools
  • 728
  • 6
  • 18
0

First they had deprecated the share button in favor of like button,(and though share continued working, as far as I experienced, it was buggy). But it seems, now (November 10, 2013) facebook lunched new share button, and it works fine again

check these links

https://developers.facebook.com/docs/plugins/share-button/

https://developers.facebook.com/blog/post/2013/11/06/introducing-new-like-and-share-buttons/

dav
  • 8,931
  • 15
  • 76
  • 140