WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Prevent loading of Twitter and FB script on Home Page (2 posts)

  1. nikhilnaik
    Member
    Posted 1 year ago #

    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?

  2. nikhilnaik
    Member
    Posted 1 year ago #

    Solved it. I used Windows Grep [wingrep.com] to search for the code and found it. Amazing tool.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.