How to Remove JS and CSS using Layout XML in Magento 2
Step 1: Go to your layout file
app\code\Vendor\Extension\view\frontend\layout\your_layout_file.xml
To remove JS and CSS, you need to add <remove> tag in layout XML under the <head> tag.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<remove src="Vendor_Extension::css/custom.css"/>
<remove src="Vendor_Extension::js/custom.js"/>
</head>
</page>
Comments
Post a Comment