I have a <link> tag in the <head> section of my default.xml file, and I'd like to prevent that particular tag from rendering on the checkout page.

Is there anything I can add to checkout_index_index.xml that would prevent this tag from being rendered?

Thank you!

2 Answers 2


To remove some block or container in magento 2 you can use remove attribute

example for block:<referenceBlock name="block_name" remove="true"/>

for more details regarding xml layout instructions: http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/layouts/xml-instructions.html

To remove some link from head you can use remove instruction in custom xml file inside the head node example:<remove src="my-js.js"/>

  • Oh, awesome-- I knew about using the remove attribute for blocks, but didn't know I could use it for src. Thanks so much!
    – brackfost
    Commented Dec 27, 2017 at 14:06
  • welcome @Brock, please mark my answer like accepted if it was helpful for your situation Commented Dec 27, 2017 at 15:16
  • There you go @JohnnySk -- tried to upvote but I don't quite have the reputation for that yet, first time learning how to mark an answer as correct. Thanks again
    – brackfost
    Commented Dec 27, 2017 at 15:30

To remove some block or container in checkout page Magento 2. you can use remove attribute from the file checkout_index_index.xml

<referenceBlock name="block_name" remove="true"/>
<referenceConatiner name="container_name" remove="true"/>
  • Yeah, knew about that, but I didn't know about <remove src="">. Thanks for answering, though!
    – brackfost
    Commented Jan 16, 2018 at 14:59

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.