How to Add Social Share Buttons to Your WordPress Site Without Plugin

Please Subscribe to our YouTube Channel

Note: This works for almost all types of websites, WordPress, PHP, HTML, or anything as long as your website allows using Javascript code.

Website owners who use WordPress CMS are usually in the habit of using installing Plugins for almost everything. There are things that can be done without Plugin. Some Plugins increase your website load time much more than the custom code or script that does the same thing. It’s really a good habit if you try not to install unnecessary plugins.

Here is the script for you that you can use at the end of every post to get the Social Share button, but please note:

  • Don’t forget to wrap the code between <script></script>tag.
  • Don’t forget to change the icon.png instances with your actual image icon URL. For example, line-icon.png should be replaced with the URL that has the icon.
  • You can use Ad Inserter or Quick Adsence plugin that most of us already use to automate advertisements to inject this code after every post or content. Or you can create a separate js file, upload it on your server, and includes the script in your theme file (if you don’t know this, using Ad Inserter will be the safest way).
  • We are using “social-icons” as id name, so you can control the display or design getting hold of this this ID #social-icons.
  • If you need help with setup, feel free to contact via email: [email protected].