Facebook share button stopped working

Hi there!

So I have a custom code for a Facebook share button on a CMS page and it stopped working this week… Everything was perfect for months… Any idea?

Here’s the code:

<a style="text-decoration:none; color:#ffffff; "title="Share on Facebook" class="w-inline-block social-share-btn fb"  href="javascript:fbshareCurrentPage()" target="_blank" alt="Share on Facebook">
Share<img class="fb-logo" border="0" src="https://uploads-ssl.webflow.com/59b8991a7fdf9700017d5b4c/5bfd93ae15e07d17fde80cbd_facebook-f-brands.svg" width="10" style="margin-left:5px !important;" alt="Share on Facebook">
</a>

<script language="javascript">
    function fbshareCurrentPage()
    {window.open("https://www.facebook.com/sharer/sharer.php?u="+escape(window.location.href)+"&t="+document.title, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false; }
</script>

Thanks! :webflow_heart:

I am pretty sure that sharer.php has been depreciated for quite some time. You should be using a supported method.

1 Like

Thanks for sharing this! I’m having the same issue as Donald, but I’m a bit confused with the different code options available on Facebook’s dev site. Is there another resource available somewhere for people who aren’t that JS savvy?

You can just use a share button.

Note to site creators: Remember that using any Facebook scripts on your site helps Facebook / and FB Advertisers track users around the web and using them should be clearly stated in your site privacy policy.

1 Like

I’ll take a look at this. Thanks!