Simple Sharing Buttons

If you just want to download the final code, see the Github repo or for more customization check out my free Simple Sharing Buttons tool. For detailed instructions, continue reading below where I will show you what code you need to use on your site.

All major social networks offer their own code for sharing your web content. Using the provided code has some major advantages, for example being able to show how many people shared your content, or even simply not having to deal so much with setting things up.

On the other hand, the buttons will fail to work if the user disabled javascript in their browser. It may also be difficult to get the buttons to work together and match the style of your page (Note: if this is your only issue, there is a plethora of third party solutions). There are also privacy/security issues, such as Facebook’s Like button tracking users who neither click the Like button nor even have a Facebook account.

Using buttons that share your content only through URLs gives you much more control over the way the buttons look on your page. The buttons are easy to implement and you know exactly how they work without having to look through the source code of the official implementation.

Let’s have a look at the code for each site.

Note: the URL of the website you want to share and other parameters, such as description, need to be encoded. For a simple URL encoding tool visit Or you can use my Simple Sharing Buttons generator.


Official documentation for Facebook’s share dialog is here. And here is the code:

<a href="" target="_blank">Share on Facebook</a>


Twitter offers so called web intents which, in their own words, make it easy to bring interactivity to Tweets that you display on the web. Web intents are actually quite powerful as they offer options to tweet, reply, retweet, favorite, and follow simply with an URL. Here we are going to look at their Tweet Web Intent.

<a href="" target="_blank">Tweet</a>

You can set the text that shows in the tweet with the text parameter and even have the user mention you in the tweet using via.


Google’s own code for sharing on Google+ offers a javascript version with a fallback when javascript is disabled. As I am removing javascript completely, I rewrote the code into this:

<a href="" target="_blank">Share on Google+</a>


Looking at the official bookmarklet I got the following code:

<a href="" target="_blank">Post to Tumblr</a>


Pinterest lets you create a Pin It button using their Widget builder. Here is a code you will need for a simple button:

<a href="" target="_blank">Pin it</a>

The media parameter takes a URL of an image you want your visitor to share on Pinterest.


I couldn’t find an official code that doesn’t rely on javascript, but this seems to work:

<a href="" target="_blank">Add to Pocket</a>

The official documentation, if you’d like to see it, is here.


Again, no official code, but exploring the code for the official bookmarklet gave me this:

<a href="" target="_blank">Submit to Reddit</a>


LinkedIn provides detailed instructions on sharing content by its URL.

Important points:

  • If you’ve provided all the details (URL, title, summary, and source) your user will choose whether to share the article with a network or to particular connections
  • If you omit some details, your user will be prompted for those details before continuing to select their distribution target. It’s always best to fully include each parameter so your user can go straight to sharing and not be slowed down by entering in data.

The code for your button:

<a href="" target="_blank">Share on LinkedIn</a>


For posting links on WordPress you can use the Press This function. Note that this works only for blogs hosted on

<a href="" target="_blank">Publish on WordPress</a>


The code for Pinboard also comes from an official bookmarklet.

<a href="" target="_blank">Save to Pinboard</a>


Let’s not forget the email 🙂

<a href="mailto:?subject=SHORTDESCRIPTION&body=MESSAGEWITHTHEURL" target="_blank">Email</a>


Here are some more share-to-social-media buttons that are not yet implemented in the Simple Sharing Buttons generator:

Hacker News

<a href="" target="_blank">Hacker News</a>


<a href="" target="_blank">Digg</a>


<a href="" target="_blank">StumbleUpon</a>


<a href="" target="_blank">Delicious</a>


<a href="" target="_blank">VKontakte</a>

More tutorials

A tinted, zoomed in screenshot of a JSON object showing server information about a Mastodon instance.
A tinted screenshot of two charts, one showing the popularity of various fediverse platforms (with Mastodon far ahead of the rest), and the other chart showing distribution of domain creation dates, mostly clustered around 2023.
A tinted screenshot showing the @mtaupdates Mastodon profile and a few example posts with subway status alerts.

💻 Browse all