• In admin, everything is turned off except sharing sidebar on single posts. However, addthis_widget.js is still loaded on all pages, archives etc. slowing the pages really bad. Sometimes it goes over 10s, and on pages it shouldn’t even be on:

    See?

    Is there a way to prevent it from loading except on single posts, or, even better, to prevent it from loading alltogether and manually (in php) get it to load on single posts?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Julka Grodel

    (@jgrodel)

    Hi marusic.

    Thanks for letting us know about your issue. Unfortunately, the functionality you’re asking for isn’t available in this plugin.

    Thanks,
    Julka

    Hi marusic,

    I checked the variable $wp_scripts, and it looks like the handle for addthis_widget.js is addthis_widget. If you enqueue the scripts, you can deregister the script like below.

    add_action( 'wp_print_scripts', function() {
    	wp_dequeue_script( 'addthis_widget' );
    }, 100 );
    

    Hope that helps.

    • This reply was modified 7 years, 6 months ago by jongyc.
    • This reply was modified 7 years, 6 months ago by jongyc.
    • This reply was modified 7 years, 6 months ago by jongyc.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to prevent loading of addthis_widget.js on all pages except single posts’ is closed to new replies.