Stop Joomla from Loading Mootools Javascript

Joomla loads Mootools.js and caption.js by default. If you have ever wondered why your simple pages load slowly, this could be the reason.

If you have nothing that uses Mootools.js (dropdown menus and such) and want to speed up your site then it would be a good idea to stop it from loading.


In your index.php file, place the following code directly above:

<jdoc:include type="head">
<?php $user =& JFactory::getUser(); if ($user->get('guest') == 1) { $headerstuff = $this->getHeadData(); $headerstuff['scripts'] = array(); $this->setHeadData($headerstuff); } ?>

This will stop mootools and caption from loading for all people viewing the website but keep it enabled for anyone above 'guest' level for the administration so you don't loose functionality in the backend.

If you want to keep the scripts but speed up mootools loading time click here.