Joomla
Remove Mootools in Joomla
Written by Abhilash Sahoo•Updated on February 1, 2023•1 min read
Removing Mootools.js and caption.js can help to reduce the page load time of your website, especially if your website has a lot of JavaScript files or if the website is loading slowly due to a slow internet connection. Additionally, removing these libraries can help to avoid conflicts with other modules or extensions that may rely on different JavaScript libraries or versions.
However, it's important to note that removing Mootools.js and caption.js from the frontend of your website may cause some parts of the website to stop working properly if they rely on these libraries. Therefore, it's important to test the website thoroughly after removing these libraries to ensure that everything is working as expected.
These are the two lines which load in the joomla website.
<script type="text/javascript" src="/media/system/js/mootools.js"></script> <script type="text/javascript" src="/media/system/js/caption.js"></script>So to disable the two lines of code we need to write the following code on the top of the index.php file of our template.
<?php //remove mootools.js and caption.js $headerstuff=$this->getHeadData(); reset($headerstuff['scripts']); foreach($headerstuff['scripts'] as $key=>$value) { unset($headerstuff['scripts'][$key]); } $this->setHeadData($headerstuff); ?>After inserting the lines of codes, refresh the frontend and clear the joomla cache.If you have problems with mootools on your Joomla website, ask us for assistance.