Magento – Remove JS & CSS using XML Layout Update

Sometimes you may want to remove JS or CSS for a specific CMS or Category or even Product Page. I was actually working on a custom CMS page that had conflicting JS that did not work with a customised collection, so needed to remove the offending JS for that particular page rather than all the CMS pages:

<reference name="head">
    <action method="removeItem"><type>skin_js</type><name>js/js_file.js</name></action>
    <action method="removeItem"><type>skin_css</type><name>css/css_file.css</name></action>

God I love Magento…


  • Really?,one thing, WHERE THE HELL I PUT THIS CODE? or i can put it where i want, maybe i can put it in the header… in the footer… in the checkout….

    I can’t bealive nobody can do a correct post about this… i can’t believe…

    • Hi there, if you want to remove js/css from a CMS Page. Go to CMS Pages in Magento’s backend and add this code to Design > Layout Update XML – hth

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.