I’d reach out directly to that plugin developer to relate your concerns, and if they’re not responsive consider a different plugin. But in the meantime, you can use wp_dequeue_script()
and wp_dequeue_style()
and their counterparts wp_enqueue_script/style to remove the stuff that’s slowing down your site.
This answer has more detail on how to move scripts from the header to the footer: https://wordpress.stackexchange.com/a/212274/16
To find the IDs of the styles/scripts you’re trying to move using those functions, View Source and look at the ID, for instance:
<link rel="stylesheet" id='eo-leaflet.js-css' href="https://....
or<link rel="stylesheet' id='mystyles-css-css' href="https://...
or<script type="text/javascript' id='coblocks-lightbox-js' src="https://...
or<script type="text/javascript' id='pluginname-script-js' src="https://...
The trick is, WordPress automatically appends -css to stylesheet IDs and -js to script IDs, so you need to IGNORE the trailing -css and -js in the examples above when figuring out their IDs. The actual IDs you”d use for wp_dequeue_script/style etc would be:
- eo-leaflet.js
- mystyles-css
- coblocks-lightbox
- pluginname-script
If you still run into issues removing them, the next thing to check is the hook being used (the add_action part in the answer referenced above). Plugins/themes use a variety of these to insert their scripts/styles so you have to adjust accordingly when trying to remove them. This answer uses different add_action calls that might work better than the ones in the previous answer:
https://wordpress.stackexchange.com/a/202895/16
(You put all this in the functions.php file of your theme.)