We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
How To Create Custom Link In Footer In Magento 2
To create a custom link in the footer of a Magento 2 store.
1: Create the Layout File
Create theapp/code/Vendor/ModuleName/view/frontend/layout/default.xml file.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="footer_links">
<block class="Magento\Framework\View\Element\Html\Link\Current" name="custom-footer-link">
<arguments>
<argument name="label" xsi:type="string">Label</argument>
<argument name="path" xsi:type="string">route/index/controller/</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
2. Explanation
<referenceBlock name="footer_links">: This references the existing block that holds the footer links in Magento 2.<block class="Magento\Framework\View\Element\Html\Link">: This block creates an HTML link.<argument name="label">: This sets the text that will be displayed for the link in the footer.<argument name="path">: This defines the URL path where the link will point. Replacecustom/routewith the desired URL.