How to Create Custom Social Share Links

Nowadays, social media sharing is the mostly required for any web projects. Some advantages of the social media sharing are

  • Reduced marketing costs.
  • Increased sales.
  • Increased traffic to your website.
  • Improved ranking on search engines.

There are so many free and easy-to-implement services out there. But all those social sharing plugins are used lot of JavaScript which is increase page load time. So, if you want to customize social sharing button as per your project theme and load page faster, then it will be a good idea to use social share buttons with custom links.

In this short article, we’ll provide custom social share links for some popular social media. Using those links you can create social share button for web page URL sharing without JavaScript.

Facebook Custom Share Link:

https://www.facebook.com/sharer.php?u=[EncodedURL]

Twitter Custom Share Link:

https://twitter.com/share?text=[TITLE]&url=[URL]

LinkedIn Custom Share Link:

https://www.linkedin.com/shareArticle?mini=true&url=[EncodedURL]

StumbleUpon Custom Share Link:

https://www.stumbleupon.com/badge/?url=[URL]

Pinterest Custom Share Link:

https://pinterest.com/pin/create/button/?url=[EncodedURL]&media=[MEDIA]

Reddit Custom Share Link:

https://www.reddit.com/submit?url=[EncodedURL]

E-Mail Custom Share Link:

mailto:?subject=[SUBJECT]&body=Check out this site [URL]

WhatsApp Custom Share Link:

https://api.whatsapp.com/send?text=[TITLE+URL]

Insert the above custom social share links into the href attribute of <a> tag. The social share anchor links would be like the below.

<a href="[CustomSocialShareLink]" target="_blank" rel="nofollow">[Social Media Share Text/Image]</a>

If you want to open the share URL on the new window like a popup, JavaScript is required. Make it easy, we’ve created a JavaScript function called genericSocialShare(). genericSocialShare() method takes the custom social share URL and open it in the new window like a popup.
JavaScript

<script type="text/javascript">
function genericSocialShare(url){
    window.open(url,'sharer','toolbar=0,status=0,width=648,height=395');
    return true;
}
</script>

HTML

<a href="javascript:void(0)" onclick="javascript:genericSocialShare('[CustomSocialShareLink]')">[Social Media Share Text/Image]</a>

Do you want to get implementation help, or enhance the functionality of this script? Click here to Submit Service Request

11 Comments

  1. Kekeli Said...
  2. Vibhor Said...
  3. Vibhor Said...
  4. SAGAR JANGAM Said...
  5. Shruti Parikh Said...
  6. Kishor Said...
  7. Arun Said...
  8. Neel Said...
  9. Ranjith Said...
  10. Cade Said...

Leave a reply

keyboard_double_arrow_up