Joomla

Remove Mootools in Joomla

Written by Abhilash SahooUpdated on February 1, 20231 min read
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

Abhilash Sahoo

Abhilash Sahoo

Abhilash Sahoo, with over 15 years of experience, is a Certified Full Stack Developer, AI/ML Automation Specialist, and Multi-Agent System Architect. As the Founder & CEO of Infyways Solutions, he leads a team specializing in agentic AI workflows, MCP server development, LLM orchestration, and intelligent automation solutions. Under his guidance, Infyways has become a trusted name in delivering RAG implementations, vector database integrations, computer vision systems, and custom AI-powered applications that transform business operations through autonomous agents and machine learning pipelines across industries.