Remove Mootools in Joomla

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.

Share the Article

Picture of Abhilash Sahoo

Abhilash Sahoo

Abhilash Sahoo, with 14 years of experience, is a Certified Joomla and WordPress Expert and the Founder & CEO of Infyways Solutions, specializing in innovative web development solutions.