Magento – Removing Links from Header Links – Magento 2

magento2PHP

Sorry if it's in the wrong category and I'm just asking for help. I'm not a developer but I've changed dabbled in Magento 1 coding mainly just removing stuff or moving it.

I'm confused how it works in Magento 2. Right clicking in Developer tools on Chrome, shows the links are sitting in header links. For the life of me, I can't find this.

I have even tried looking under default.xml under the theme I have bought and this is the only code in the file.

<referenceContainer name="header-wrapper-container">
<container name="header.wrapper.container.top" htmlTag="div" htmlClass="header-wrapper-container-top" before="-">
<container name="header.area.1" htmlTag="div" label="Header Area 01" htmlClass="header-area-01 hidden-xs" before="-" />     

</container>

<container name="header.wrapper.container.bottom" htmlTag="div" htmlClass="header-wrapper-container-bottom" after="header.wrapper.container.top">
<block class="Magento\Theme\Block\Html\Header\Logo" name="smalllogo" template="html/header/smalllogo.phtml" before="-" />  

</container>
</referenceContainer>

<move element="logo" destination="header.wrapper.container.top" after="header.area.1" />
<move element="navigation.sections" destination="header.wrapper.container.bottom" after="smalllogo" />


<referenceBlock name="footer_links" display="true" />                   

<move element="footer_links" destination="footer" after="copyright" />
</body>
</page>

I have two Links I want to remove (Wishlist and Compare as seen here – www.peakaboo.co.uk. I also want to move the Cart into the navigation like http://newsmartwave.net/magento/vigoshop/index.php/?___store=demo2_default.

I've checked through most folders and found other other phtml files but nothing about header links, or top.links. (I've also tried that top.links).

I hope someone can help me.

Regards,

Best Answer

Please follow the below instructions :

Step 1 :- Go to app/design/frontend/VenderName/ThemeName/Magento_Theme/layout/default.xml

Step 2 :- Copy below Code

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

Step 3 :- Paste this code in default.xml before body tag () and save it.

It will remove the links from the header

Related Topic