I have created a new Design Layout (named "blank") for select in page creation in my theme i have these created.


<?xml version="1.0" encoding="UTF-8"?><page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">

<layout id="blank">
    <label translate="true">Blank</label>


<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<container name="root">
        <container name="main.content" htmlTag="main" htmlId="maincontent" htmlClass="page-main">
            <container name="columns" htmlTag="div" htmlClass="columns">
                <container name="main" label="Main Content Container" htmlTag="div" htmlClass="column main"/>

This make the option to appear on the admin select design when i add new page but when i check the source code i can see that everything is loaded in head ( css from other pages and js ) i want a clean layout and been able to add css via Layout XML update in admin.

enter image description here

all the selected code in the image should not be there

i am pretty new to this i would appreciate some help on what i am doing wrong. Thank you.

1 Answer 1


Adding new CSS


<?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">
        <css src="css/newtheme.css" />

Remove static resources (JavaScript, CSS, fonts) To remove the static resources, linked in a page , make a change similar to the following in a theme extending file app/design/frontend///Magento_Theme/layout/default_head_blocks.xml

    <!-- Remove local resources -->
    <remove src="css/styles-m.css" />
    <remove src="my-js.js"/>
    <remove src="Magento_Catalog::js/compare.js" />

<!-- Remove external resources -->
    <remove src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"/>
    <remove src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"/>
    <remove src="http://fonts.googleapis.com/css?family=Montserrat" /> 


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.