[resolved] How do I remove Facebook SDK from website footer? (7 posts)

  1. mezanul
    Posted 4 years ago #

    I am facing one problem, how do I remove the Facebook SDK inserted by the plugin? I already have http://connect.facebook.net/en_US/all.js called in my footer, I don't want it again. This is causing the same script to be called twice?

    Please provide a option to exclude inserting the script, if a website already have it.



    P.S. Sorry, I posted this problem in the wrong section earlier at http://wordpress.org/support/topic/how-do-i-remove-facebook-sdk

    I couldn't find a delete button to delete my earlier support post.

  2. mattkelly
    Posted 4 years ago #

    Can you disable the other plugin?

    We'll look into the best way of supporting this.

  3. mezanul
    Posted 4 years ago #

    Actually, I have it in a custom javascript that loads all social network scripts without hampering or blocking the page loading. This improves page speed dramatically. :)

    Hopefully, you will offer an option to exclude inserting the FB script. Until, then I will keep the plugin disabled and watch out for the update.

    Thanks for the awesome features in the plugin though... Great work! :)

  4. Niall Kennedy
    Plugin Author

    Posted 4 years ago #

    The Facebook JavaScript SDK is enqueued with the handle "fb-connect." If your custom code references the same handle you should not have problems.

    If you are inserting this code directly through your theme and believe you've properly initialized the SDK you can remove fb_js_sdk_setup from the wp_head action.

  5. mezanul
    Posted 4 years ago #

    Thanks for your reply. I tried adding the following in my theme's function file, but it is not removing the FB JS SDK.

    remove_action('wp_head', 'fb_js_sdk_setup');
    wp_deregister_script( 'fb-connect' );

    Please correct me if I am doing something wrong.

  6. Niall Kennedy
    Plugin Author

    Posted 4 years ago #

    You'll want to remove the action after init but before wp_head, not during theme setup. Add a new function in your theme file and tie it to init with a priority of 11.

  7. mezanul
    Posted 4 years ago #

    Thanks Niall!

    I created the following function and it removed the FB JS SDK from my footer. :)

    function my_fbjs_unregister() {
      remove_action('wp_head', 'fb_js_sdk_setup');
    add_action( 'init', 'my_fbjs_unregister', 11 );

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Facebook
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic