Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 134480

nikhilnaik on "Prevent loading of Twitter and FB script on Home Page"

$
0
0

Hello,

The following script loads in the index page of my blog although there is no social media element in my homepage. [I picked it from the source code of my blog http://www.bloggercent.com]

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script><script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script><script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=136911316406581";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

I am also not using any social media plugin. But I don't know how the twitter, Google Plus and facebook share button script gets loaded on my homepage. I tried deactivating many of the plugins which have the social media element in them, but it did not help. How do I get rid of this or at least block the loading of these 3 scripts so as to reduce the number of requests?


Viewing all articles
Browse latest Browse all 134480

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>