Sometimes, there is a need to remove some static resources(CSS and JS) from a page as there may be conflicts between the theme and the module(extensions) static resources(CSS and JS).
The <remove> tag is used in layout XML under the <head> tag to remove the static resources(CSS and JS files) linked to a page.
Note, that if a static asset is added with a module path (for example Vendor_Module::js/name.js) in the initial layout, you need to specify the module path when removing the asset.
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <remove src="name.css"/> <remove src="css/name.css"/> <remove src="js/name.js"/> <remove src="Vendor_Module::js/name.js"/> </head> </page>
If you want to remove static resources(CSS and JS files) on all pages then you need to create a default.xml, the code will be as above only.
For more reference please visit the following link – Layout customizations
Thanks.