I badly wanted to know how to do this as well and I couldn't make headspace do exactly what I wanted. Which was to remove the plugin code included by plugins on specific pages...
I found one solution but its a little tricky. It involves editing the code for those plugins you want to remove the code for. Each plugin will have a block of code that is used to insert whatever it is that the plugin needs in the <head> of your site. Only problem, like we know, is that the code is inserted into every page and it is usually only needed on one page.
An example: I'm using the excellent cforms form plugin as a contact form on a contact page (id = 12). So I opened up the cforms main code in the plugin editor and did a quick find for '<script' and soon found the block I was looking for:
function cforms_style() {
global $cforms_root, $localversion;
echo "\n\t<!-- Start Of Script Generated By cforms v".$localversion." [Oliver Seidel | www.deliciousdays.com] -->\n";
echo "\t".'<link rel="stylesheet" type="text/css" href="' . $cforms_root . '/styling/' . get_option('cforms_css') . '" />'."\n";
echo "\t".'<script type="text/javascript" src="' . $cforms_root. '/js/simplecalendar.js"></script>'."\n";
echo "\t".'<script type="text/javascript" src="' . $cforms_root. '/js/cforms.js"></script>'."\n";
if( get_option('cforms_datepicker')=='1' )
echo "\t".'<script type="text/javascript">'."\n".
"\t".'var dp = new CalendarPopup(\'datepicker\');'."\n".
"\t".'dp.setTodayText(\''.stripslashes(get_option('cforms_dp_today')).'\');'."\n".
"\t".'dp.setMonthNames('.stripslashes(get_option('cforms_dp_months')).');'."\n".
"\t".'dp.setDayHeaders('.stripslashes(get_option('cforms_dp_days')).');'."\n".
"\t".'</script>'."\n";
echo "\t".'<!-- End Of Script Generated By cforms -->'."\n\n";
}
All I did was add a little conditional logic courtesy of wordpress to insert the above block of code only if on a specific page - you could also do sets of pages, categories or whatever else is at your disposal. So from the above I ended up with:
function cforms_style() {
global $cforms_root, $localversion;
if (is_page('12')) { //only link style and script if on contact page
echo "\n\t<!-- Start Of Script Generated By cforms v".$localversion." [Oliver Seidel | www.deliciousdays.com] -->\n";
echo "\t".'<link rel="stylesheet" type="text/css" href="' . $cforms_root . '/styling/' . get_option('cforms_css') . '" />'."\n";
echo "\t".'<script type="text/javascript" src="' . $cforms_root. '/js/simplecalendar.js"></script>'."\n";
echo "\t".'<script type="text/javascript" src="' . $cforms_root. '/js/cforms.js"></script>'."\n";
if( get_option('cforms_datepicker')=='1' )
echo "\t".'<script type="text/javascript">'."\n".
"\t".'var dp = new CalendarPopup(\'datepicker\');'."\n".
"\t".'dp.setTodayText(\''.stripslashes(get_option('cforms_dp_today')).'\');'."\n".
"\t".'dp.setMonthNames('.stripslashes(get_option('cforms_dp_months')).');'."\n".
"\t".'dp.setDayHeaders('.stripslashes(get_option('cforms_dp_days')).');'."\n".
"\t".'</script>'."\n";
echo "\t".'<!-- End Of Script Generated By cforms -->'."\n\n";
} else { // else display nothing
}
}
Notice the little if line of code where im checking if we're on page id 12 then insert the following code. Else, don't. I Don't know if I needed the else in there but oh well it works. If you ran into any problems just make sure that you've opened and closed all the brackets and that your code is formatted properly.
Now of course with each plugin you're probably not going to have an identical block of code like above, but thats the challenge! Basically though you just have to find the block of code in the plugin where it inserts its code to be placed in the <head> and use some conditional logic.
Good luck!