Support » Plugins » Can WP hack restrict plug-in from global loading?

  • Since WP knows ‘where’ it is–what page or post is being loaded–why after all of these editions and releases, month after month, year after year do so many popular plugins keep being written and approved for the official plugins site that call themselves up on every single page, loading superfluous js or css scripts when the plugin function is not even installed for that page?

    Why isn’t WP as a matter of practice telling plugin writers to keep their functions out of the loop until actually used? Or is this a core flaw with how WP itself loads up associated scripts for all installed-activated plugins?

    Too many plugins throw their http calls into the loop in the header demanding to load unneeded js and css for every page even when they are not in use, simply activated in the control panel. I am trying to optimize my site and other php programs I use only load the appropriate scripts for the page and plugin used.

    Can I alter the scripts in these offending plugins with a simple modification that keeps them confined to the page that actually uses their functionality?

    Dagon Design Formmailer Script dd-formmailer/dd-formmailer.css

Viewing 1 replies (of 1 total)
  • I have the same problem. Lots of JS and CSS that should not be loaded in every page. There is a sollution for contac-form-7

    Put these to wp-config.php

    define ('WPCF7_LOAD_JS', false);
    define('WPCF7_LOAD_CSS', false);

    And to call WPCF7 in a page


    Before wp_head() is called

    More info from contac-form-7 homepage > docs

Viewing 1 replies (of 1 total)
  • The topic ‘Can WP hack restrict plug-in from global loading?’ is closed to new replies.