6

In Magento/Blank an advanced search link appears under the search form by default. I have unsuccessfully been attempting to remove this by referencing the block name for removal. My issue is, not being able to determine what the actual block is called. Turning on path hints and block names was not helpful, nor was looking in the module folder. What am I missing?

<referenceBlock name="advanced.search" remove="true"/>

2 Answers 2

16

it's the solution:

<referenceBlock name="advanced-search-link" remove="true"/>

every static links search it inside default.xml of any module our case is in : vendor/magento/module-catalog-search/view/frontend/layout/default.xml

3
  • The link still shows in my store. I added the default.xml inside mytheme/Magento_Catalog-search/layout/ . Is that the right folder to put this file into? May 16, 2016 at 17:04
  • I used it inside my theme at mytheme/Magento_Search/layout/default.xml. My code is the following <referenceContainer name="header.row"> <block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="Magento_Search::form.mini.phtml" after="store.menu" /> <referenceBlock name="advanced-search-link" remove="true"/> </referenceContainer>
    – Phil Cook
    Nov 10, 2016 at 9:48
  • 1
    that is not the correct path. You should not modify anything in vendor/magento
    – styzzz
    Jul 22, 2017 at 22:04
2

The correct path to folder is

app/design/frontend/ThemeDirectory/YourTheme/default.xml

Open default.xml & Put this code anywhere after

<body>
<referenceBlock name="advanced-search-link" remove="true"/>

It will remove the advanced - search link from ALL THE PAGES.

1
  • 1
    Magento 2.3 This worked for me <referenceBlock name="catalog-search-advanced-link" remove="true"/> Oct 13, 2019 at 17:43

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.