Removing useless jQuery scripts in Joomla
/media/jui/js/jquery.min.js two more scripts are always loaded:
But if your website doesn't use old deprecated MooTools and there are no issues with JUI version of jQuery (v1.12.4), you can disable loading of these extra scripts to reduce the number of requests.
Just pre-load jQuery framework with the scripts disabled:
JHtml::_('jquery.framework', false, false, false);
Additionally, you can remove these scripts right in your Joomla template by unsetting the elements from
JFactory::getDocument()->_scripts array referenced as
$this->_scripts in template's index.php file.
Joomla 4 notes:
Joomla 4 introduced WEB asset manager which has the special code:
But note that another scripts can have jQuery as dependency and the files will still be included.