Since loading these files takes time and extra requests from the browser, we try to reduce their number and size. The tricky part is to identify which scripts are required on which pages. Sometimes we can figure this out automatically, but considering all the cases with various themes, widgets and other plugins that add their own modifications it is unavoidable that you optimize your site manually.
Try to load scripts only where you need them #
Deselect the option “Always load shortcode scripts.” in the Tag Groups settings -> Front End. Then empty the cache (if you use a plugin or service for caching) and reload all pages where you use Tag Groups features.
With this option deactivated, the plugin tries to automatically identify the posts and pages where scripts need to be loaded. For that to work, however, the shortcode or block must be present in the content part of this page or post. If you insert it in a widget or if your theme adds them later, you need to keep this option activated. The only way to find out is by trying.
If you have to keep this option activated, you could then try a plugin such as Asset CleanUp: Page Speed Booster to load only required scripts per page. For all tabs and accordions you will need the jQuery UI scripts and
Combine and defer scripts #
3. Bonus hint: Deactivate debugging mode on your live site #
If you don’t use your site in debugging mode, the Tag Groups plugin always uses minimized scripts. You can identify them in the HTML code by their extensions .min.js and .min.css. By default, debugging mode is off.