Direct Share Links for Social Networks

GeekThis remains completely ad-free with zero trackers for your convenience and privacy. If you would like to support the site, please consider giving a small contribution at Buy Me a Coffee.

With all the various ways you can have your visitors, community or fans share your content with their friends, you have a lot of options to pick from. You can either set up all the javascript for each button, which will end up having to load a lot of extra resources on each page. You can use a service like ShareThis which creates a bar that has various sharing methods that you can customize, but still not have full control of the buttons. Or the best method, create your own setup which you can pick the images, layout, and not have to load any external resources.

With creating your own method, all you have to do is link an image or text to the proper website address. Below I have listed the most popular services and their sharing links. You can use these urls inside your javascript to create the buttons, in PHP scripts or just normal links inside of pages and emails.

In the following links, there are some “variables” you will have to change. Always test the link before just publishing it on your site. I tried to test out all of the follow social networks, but since I don’t have some of them, I couldn’t test them.

When I mention that something has to be encoded below, I mean URL Encoded. This encoding changes all non-alphanumeric characters besides -_. (dash, underscore, period) to it’s hexadecimal value append to a % (percent) symbol. For example, a $ (dollar sign) would be turned into %24. Spaces are replaced with a + (plus) sign.

Variables:
	ENCODED_URL:  Website url that is encoded.
	HASH_TAGS: Text of hashtags, separated by commas. Does not include the hash symbol.
	ENCODED_TEXT: Website Description or various text to be shown along with link. This content has to be encoded.
	ENCODED_TITLE: The website title or headline. Content has to be encoded.
	ENCODED_IMAGE_URL: An image url to be shared along with the URL. This has to be encoded.
	ENCODED_QUOTE: Same as ENCODED_TEXT, but is a quote you are sharing with others.
	QUOTE_SOURCE: The source of a quote. Either a person or a website link. Has to be encoded.
	YOUTUBE_USERNAME: A youtube username. Doesn't have to be encoded since all usernames are alpha-numeric.

Google Plus:
	https://plus.google.com/share?url=ENCODED_URL

Twitter:
	https://twitter.com/intent/tweet?hashtags=HASH_TAGS&text=ENCODED_TEXT&url=ENCODED_URL

Facebook:
	https://www.facebook.com/sharer/sharer.php?u=ENCODED_URL

Digg:
	http://digg.com/submit?url=ENCODED_URL

StumbleUpon:
	http://www.stumbleupon.com/badge/?url=ENCODED_URL

Reddit:
	http://www.reddit.com/submit?url=ENCODED_URL&title=ENCODED_TITLE

Pinterest:
	http://www.pinterest.com/pin/create/button/?url=ENCODED_URL&media=ENCODED_IMAGE_URL&description=ENCODED_TEXT

LinkedIn:
	http://www.linkedin.com/cws/share?isFramed=true&url=ENCODED_URL

Tumblr:
	Share Link
		http://www.tumblr.com/share/link?url=ENCODED_URL&name=ENCODED_TITLE&description=ENCODED_TEXT
		http://www.tumblr.com/share?v=3&u=ENCODED_URL&t=ENCODED_TITLE

	Share Quote
		http://www.tumblr.com/share/quote?quote=ENCODED_QUOTE&source=QUOTE_SOURCE

	Share Picture
		http://www.tumblr.com/share/photo?source=ENCODED_IMAGE_URL&caption=ENCODED_TEXT&click_thru=ENCODED_URL

YouTube Subscribe:
	http://www.youtube.com/subscription_center?add_user=YOUTUBE_USERNAME

Related Posts

Monitor Website Status with Twitter

Add another monitoring method for your site by monitoring Twitter in real time. This small Go script will display all tweets that mention any of the terms you want to track.

Website Admin Panel on Private Network

Split your website into two parts, administrative and public access. This post talks a little about having your website's control panel on your private network as apposed to publicly available.

How to Separately Handle Multiple Website Deployments

Learn how to configure your computer to run multiple website deployments with rsync and multiple Linux accounts.

Backup Evolution using the Terminal

Learn how to backup all of your Evolution data through the terminal by using a simple command. There is no longer a need to open Evolution to perform backups.