How to create social share buttons for your website very simply and without any plugins

Close-up of mobile phone with a cloud of apps
Image Source: Freepik

Most of the time, even for the simplest things, the first thing that comes to mind is that we will find a ready-made solution or a plugin that will do the job for us. My experience has shown me that in this case in the end we waste more time wanting to configure or upgrade the plugin or the ready-made solution that we found on the internet.

For this reason, I list the three simple links that I also use at the end of each article to share on Twitter, Facebook and LinkedIn.

* Where braces {} replaced with your own values.

1. Twitter

                  
                    <a href="https://twitter.com/intent/tweet?text={Text} {URL}">Share on Twitter</a>
                  
                

2. Facebook

                  
                    <a href="https://www.facebook.com/sharer/sharer.php?u={URL}">Share on Facebook</a>
                  
                

To set how you want the page you share on facebook to appear, you must have set the Open Graph Metadata.

3. LinkedIn

                  
                    <a href="https://www.linkedin.com/shareArticle?mini=true&url={URL}&title={Title}&summary={Description}&source={Website Name}">Share on LinkedIn</a>
                  
                

In case you want to use the above links in more than one page then logically you will need to use a dynamic way of filling in the links and texts. For example, if you use Wordpress and want to put links at the end of each article, you can dynamically get these values with the commands <?php the_title(); ?> και <?php the_permalink(); ?>.

Share this article on:    Twitter    Facebook    LinkedIn

Let's start your project together

Expression of Interest