Learn how to remove Magento 2 footer links in your theme

Learn how to remove Magento 2 footer links in your theme

If you want to remove the default links of whatever Magento 2 layout, there are many tutorials around a web. But if you want to save any changes in the default or custom theme when updating your template to the next Magento 2 version, here is an easy and simple tutorial.

It will be about the following footer links: Privacy and Cookie Policy, Search Terms, Contact Us, Orders and Returns, Advanced Search, Site Map.

Continue to read to get the instructions on how to remove the footer links in Magento 2 theme and keep the changes you’ve applied stay active in the further Magento 2 versions.

Magento 2 footer links removal

The results will be shown in the example of premium Magento 2 theme Argento Stripes.

Open the folder of your active Magento 2 theme. Then you have 2 ways to go:

#1 In case you have Magento_Theme/layout/default.xml, please add the following content to the BODY element:



<!-- Privacy policy -->
<referenceBlock name="privacy-policy-link" remove="true"/>
<!-- Search terms -->
<referenceBlock name="search-term-popular-link" remove="true"/>
<!-- Advanced search →
 <referenceBlock name="catalog-search-advanced-link" remove="true"/>
<!-- Guest form link -->
<referenceBlock name="sales-guest-form-link" remove="true"/>
<!-- Swissup Sitemap footer link →
<referenceBlock name="sitemap-link-footer" remove="true"/>     

Don’t forget to apply “remove instructions” only to the footer links you want to remove.

#2 In case there is no Magento_Theme/layout/default.xml, please create it and add the following content there:



    <?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>
            <!-- Privacy policy -->
            <referenceBlock name="privacy-policy-link" remove="true"/>
            <!-- Search terms -->
            <referenceBlock name="search-term-popular-link" remove="true"/>
            <!-- Advanced search -->
            <referenceBlock name="catalog-search-advanced-link" remove="true"/>
            <!-- Guest form link -->
            <referenceBlock name="sales-guest-form-link" remove="true"/>
            <!-- Swissup Sitemap footer link -->
            <referenceBlock name="sitemap-link-footer" remove="true"/>              
        </body>
    </page>

#3 See the result.

Now you can rest assured you don’t lose any customizations when upgrading your Magento 2 theme to the latest version.

In a summary

You can also find other helpful tutorials about Magento and Magento 2 that will support you on your way to the website success:

Please contact us, if you want to read more about Magento/Magento 2 functionality. We are ready to help you.

Popular Magento Themes & Extensions

Leave a Reply