{"id":2373,"date":"2012-03-15T15:53:51","date_gmt":"2012-03-15T19:53:51","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2012\/03\/15\/302-disable-mootools-in-joomla-25\/"},"modified":"2021-08-16T23:46:05","modified_gmt":"2021-08-17T03:46:05","slug":"disable-mootools-in-joomla-25","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/","title":{"rendered":"Joomla 2.5 &#8211; Disable mootools"},"content":{"rendered":"\n<p>Mootools is a lightweight <a href=\"\/support\/edu\/joomla\/joomla-3\/library-versions\/\">javascript framework used in Joomla<\/a> 2.5. Your Joomla website will by default include both mootools-core.js (92.9 KB) and mootools-more.js (233 KB). Mootools is used mostly in your Joomla Admin Dashboard, it is not used often in Joomla templates.<\/p>\n\n\n\n<p class=\"alert alert-danger\"><span style=\"color: #ff0000;\"><strong>UPDATE  &#8211; 2012.05.11<\/strong><\/span><br>After several months of testing Joomla 2.5 and various components, we have found that if you disable mootools you may break a lot of features. For example, while testing VirtueMart, we lost all search filter functionality. After enabling mootools, the problems were resolved. Therefore, we do not recommend disabling mootools. <strong>DISABLE MOOTOOLS AT YOUR OWN RISK.<\/strong><\/p>\n\n\n\n<p>If your Joomla website does not use mootools, it may benefit you to disable mootools. If you disable mootools in Joomla 2.5, you can:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Increase page download speed by removing 325.9 KB of un-needed javascript code<\/li><li>Reduce the number of conflicts caused between mootools and other javascript frameworks, such as jQuery<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to disable MooTools in Joomla 2.5<\/h2>\n\n\n\n<ol class=\"article_list\"><li>\n\t\t<p>Using your favorite file editor, open for edit:<\/p>\n\t\t<p><strong>libraries\/joomla\/document\/html\/renderer\/head.php<\/strong><\/p>\n\t<\/li><li>\n\t\t<p>Find this code at line 151:<\/p>\n\t\t<pre \"code_blocks\">\/\/ Generate script file links\nforeach ($document-&gt;_scripts as $strSrc =&gt; $strAttr)\n{\n    $buffer .= $tab . '&lt;script src=\"' . $strSrc . '\"';\n    if (!is_null($strAttr['mime']))\n    {\n        $buffer .= ' type=\"' . $strAttr['mime'] . '\"';\n    }\n    if ($strAttr['defer'])\n    {\n        $buffer .= ' defer=\"defer\"';\n    }\n    if ($strAttr['async'])\n    {\n        $buffer .= ' async=\"async\"';\n    }\n    $buffer .= '&lt;\/script&gt;' . $lnEnd;\n}<\/pre>\n\t\t<p>&#8230; and update it to include the code (highlighted in green below):<\/p>\n\t\t<pre \"code_block\">\/\/ Generate script file links\nforeach ($document-&gt;_scripts as $strSrc =&gt; $strAttr)\n{\n<strong><span style=\"color: #008000;\">    \/\/ Code to disable mootools for your site (still loads it for your admin)\n    \/\/ Written by Brad Markle w\/ InMotionHosting.com\n    $ex_src = explode(\"\/\",$strSrc);\n    $js_file_name = $ex_src[count($ex_src)-1];\n    $js_to_ignore = array(\"mootools-core.js\",\"mootools-more.js\");\n    if( in_array($js_file_name,$js_to_ignore) AND substr_count($document-&gt;baseurl,\"\/administrator\") &lt; 1 AND $_GET['view'] != 'form')\n        continue;<\/span><\/strong>\n\n    $buffer .= $tab . '&lt;script src=\"' . $strSrc . '\"';\n    if (!is_null($strAttr['mime']))\n    {\n        $buffer .= ' type=\"' . $strAttr['mime'] . '\"';\n    }\n    if ($strAttr['defer'])\n    {\n        $buffer .= ' defer=\"defer\"';\n    }\n    if ($strAttr['async'])\n    {\n        $buffer .= ' async=\"async\"';\n    }\n    $buffer .= '&lt;\/script&gt;' . $lnEnd;\n}<\/pre>\n\t<\/li><li>\n\t\t<p>After saving the changes above, clear any cache that you have set and test your Joomla website and your Joomla Admin Dashboard. If you view the source code, mootools should not load on your site but it will load in your Joomla Admin Dashboard.<\/p>\n\t<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Notes:<\/strong><\/h3>\n\n\n\n<p class=\"alert alert-info\">If your Joomla 2.5 Admin folder is not named &#8220;administrator&#8221;, update this section of code with the correct folder name:<br> <strong>substr_count($document-&gt;baseurl,&#8221;\/administrator&#8221;)<\/strong><\/p>\n\n\n\n<p class=\"alert alert-info\">If you would like to disable other scripts, such as caption.js, add it to the js_to_ignore array, as in:<br> <strong>$js_to_ignore = array(&#8220;mootools-core.js&#8221;,&#8221;mootools-more.js&#8221;,&#8221;caption.js&#8221;);<\/strong><\/p>\n\n\n\n<div class=\"alert alert-warning\"><p><span style=\"color: #ff0000;\"><strong>UPDATE &#8211; 2012.04.04<\/strong><\/span><br>While writing other Joomla 2.5 tutorials, I&#8217;ve learned that the frontend article submission form requires mootools. If you disabled mootools and clicked the &#8220;Save&#8221; button when trying to save an article, nothing would happen. I updated the code above to include:<\/p>\n<pre class=\"code_block\"><strong><span style=\"color: #008000;\">AND $_GET['view'] != 'form'<\/span><\/strong><\/pre>\n<p>If you are on a form on your website, this line of code will allow mootools to load.<\/p><\/div>\n\n\n\n<p>If you are experiencing any issues due to this modification, feel free to post a comment at the bottom of this page and we&#8217;ll be happy to review.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mootools is a lightweight javascript framework used in Joomla 2.5. Your Joomla website will by default include both mootools-core.js (92.9 KB) and mootools-more.js (233 KB). Mootools is used mostly in your Joomla Admin Dashboard, it is not used often in Joomla templates. UPDATE &#8211; 2012.05.11After several months of testing Joomla 2.5 and various components, we<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/\"> Read More ><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4403,82],"tags":[2113],"class_list":["post-2373","post","type-post","status-publish","format-standard","hentry","category-joomla","category-joomla-2-5","tag-joomla-v2-5"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Joomla 2.5 - Disable mootools | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"With a quick modification to Joomla 2.5, you can disable mootools to increase page load time.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Joomla 2.5 - Disable mootools | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"With a quick modification to Joomla 2.5, you can disable mootools to increase page load time.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2012-03-15T19:53:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T03:46:05+00:00\" \/>\n<meta name=\"author\" content=\"Brad Markle\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brad Markle\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/\"},\"author\":{\"name\":\"Brad Markle\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf\"},\"headline\":\"Joomla 2.5 &#8211; Disable mootools\",\"datePublished\":\"2012-03-15T19:53:51+00:00\",\"dateModified\":\"2021-08-17T03:46:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/\"},\"wordCount\":380,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"keywords\":[\"Joomla v2.5\"],\"articleSection\":[\"Joomla\",\"Joomla 2.5\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/\",\"name\":\"Joomla 2.5 - Disable mootools | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2012-03-15T19:53:51+00:00\",\"dateModified\":\"2021-08-17T03:46:05+00:00\",\"description\":\"With a quick modification to Joomla 2.5, you can disable mootools to increase page load time.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Joomla 2.5 &#8211; Disable mootools\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf\",\"name\":\"Brad Markle\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/bradm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Joomla 2.5 - Disable mootools | InMotion Hosting","description":"With a quick modification to Joomla 2.5, you can disable mootools to increase page load time.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/","og_locale":"en_US","og_type":"article","og_title":"Joomla 2.5 - Disable mootools | InMotion Hosting","og_description":"With a quick modification to Joomla 2.5, you can disable mootools to increase page load time.","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2012-03-15T19:53:51+00:00","article_modified_time":"2021-08-17T03:46:05+00:00","author":"Brad Markle","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Brad Markle","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/"},"author":{"name":"Brad Markle","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf"},"headline":"Joomla 2.5 &#8211; Disable mootools","datePublished":"2012-03-15T19:53:51+00:00","dateModified":"2021-08-17T03:46:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/"},"wordCount":380,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"keywords":["Joomla v2.5"],"articleSection":["Joomla","Joomla 2.5"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/","name":"Joomla 2.5 - Disable mootools | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2012-03-15T19:53:51+00:00","dateModified":"2021-08-17T03:46:05+00:00","description":"With a quick modification to Joomla 2.5, you can disable mootools to increase page load time.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/joomla\/joomla-2-5\/disable-mootools-in-joomla-25\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Joomla 2.5 &#8211; Disable mootools"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf","name":"Brad Markle","url":"https:\/\/www.inmotionhosting.com\/support\/author\/bradm\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=2373"}],"version-history":[{"count":5,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2373\/revisions"}],"predecessor-version":[{"id":86228,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2373\/revisions\/86228"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=2373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=2373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=2373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}