Magento 2 – Remove Advanced Search Link From Header

catalogsearchlayoutlayout-updatemagento-2.1magento2

I am trying to remove the advanced search link from the header in Magento 2 but it doesn't seem to be disappearing after I've extended the default.xml layout file found in the catalog search module. My default.xml file is located in the following directory:

(theme_dir)/Magento_CatalogSearch/layout/default.xml

And contains the following contents:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="advanced-search-link" remove="true"/>
</body>
</page>

Is this the correct way to extend the catalog search default layout file? In order to remove a block from layout do you have to override the layout file rather than extend it?

Best Answer

The following link helped me resolve the issue:

Remove advanced search link from top.search in Magento 2