1

I have added below code in my custom Magento_Theme default.xml file to remove top.links

  <referenceBlock name="top.links">
     <referenceBlock name="register-link" remove="true"/>
      <!--for Create Account Link-->
      <referenceBlock name="wish-list-link" remove="true"/>
      <!--for WishList Link-->
      <referenceBlock name="my-account-link" remove="true"/>
      <!--for My Account Link-->
  </referenceBlock>

all other links removed but wishlist not remove

3
  • Do you talk about comes in the dropdown?
    – Ravi Soni
    Jul 2, 2019 at 10:30
  • yes,which are included in top.links block @RaviSoni Jul 2, 2019 at 10:31
  • Your added code is working in fresh setup. wish-list-link
    – Ravi Soni
    Jul 2, 2019 at 10:39

4 Answers 4

1

You can remove the link using your store admin panel. In order to do this, log into your Magento store admin panel.

Admin > Store > Configuration > Customer > Wishlist >General option > Enable

Set to No Click on the Save Config button.

enter image description here

Run php bin/magento c:f

Take reference from here Magento 2. How to Manage Top (Header) Links

I hope it helps!

9
  • why it's working? what is Admin > Store > Configuration > Customer > Wishlist >General option > Enable? Jul 2, 2019 at 11:23
  • See this link zemez.io/magento/support/how-to/… Jul 2, 2019 at 11:23
  • It removes wishlist link from header top link. Jul 2, 2019 at 11:24
  • if have not set above config to No then it's working using <referenceBlock name="multiple-wish-list-link" remove="true"/> anyway thanks!! Jul 2, 2019 at 11:26
  • Welcome. thanks for appreciation :) +1 for appreciation Jul 2, 2019 at 11:28
0

app/design/frontend/vendorName/themeName/Magento_Wishlist/layout/default.xml

<?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">
    <body>
        <referenceBlock name="wish-list-link" remove="true" />
    </body>
</page>
0

You don't need to call

<referenceBlock name="wish-list-link" remove="true"/>

under

<referenceBlock name="top.links">

Just put it under

<body>

and

</body>

tags, without covering it under its parent block.

The final block should look like:

<?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">
    <body>
        ...
        <referenceBlock name="wish-list-link" remove="true" />
        ...
    </body>
</page>

Note: Although your file path seems correct, for any other person having a similar problem, the file path should be like app/design/frontend/{vendor}/{themeName}/Magento_Wishlist/layout/default.xml

0

For Remove Wishlist Link From Header in magento2.3.1,You can only add this line in your defualt.xml.

<referenceBlock name="wish-list-link" remove="true" />

Thanks.

Your Answer

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

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