---
title: "How to Add Dynamic Link to Footer in Magento 2?"
url: "https://magecomp.com/blog/add-dynamic-link-footer-magento-2/"
date: "2020-07-13T18:54:44+00:00"
modified: "2025-02-20T10:51:35+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 410
reading_time: "3 min read"
summary: "Hello Magento Family ? "
description: "Footers are added at the bottom of every webpage that may include page numbers, copyrights, logo, or links. Learn How to add Dynamic Link to Footer in Magent..."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Override Configurable Product Price with Simple Product Price in Magento"
    url: "https://magecomp.com/blog/override-configurable-product-price-with-simple-product-price-magento/"
  - title: "Exclusive List of Best Magento SEO Plugins in 2026"
    url: "https://magecomp.com/blog/best-magento-seo-plugins/"
  - title: "Magento 2: Get Orders Collection Between a Date Range"
    url: "https://magecomp.com/blog/magento-2-get-orders-collection-between-a-date-range/"
---

# How to Add Dynamic Link to Footer in Magento 2?

_Published: July 13, 2020_  
_Author: Dhiren Vasoya_  

![How to Add Dynamic Link to Footer in m2](https://magecomp.com/blog/wp-content/uploads/2020/07/How-to-Add-Dynamic-Link-to-Footer-in-m2-1024x512.webp)

**Hello Magento Family ?**

Hope you’re safe and sound. Welcome to Magento 2 How to blog series. Today’s article is on How to add Dynamic Link to Footer in Magento 2. Coincidentally, if you missed out on our last published blog [[Solved] MySQL: Error while sending QUERY packet. PID=XXX” with Magento 2 Migration](https://magecomp.com/blog/solved-mysql-error-sending-query-packet-pidxxx-magento-2-migration/).
[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-2-2.webp)](https://magecomp.com/services/magento-upgrade-services/)

## Introduction:
Footers are the major components of a website. Footers are added at the bottom of every webpage that may include page numbers, dates, copyrights, logo, or links. One can add dynamic links to the footer in order to redirect users to other essential pages of the website. Adding references to the footer helps to catch the customer’s attention and boost sales by redirecting them to make the final purchase or other information.
With the below-mentioned code, you can add Dynamic Link to Footer in your Magento 2 store to increase the user experience. Let’s go for it ?
## Steps to add Dynamic Link? to Footer in Magento 2:
**Step 1 :** First of all, you need to Create **default.xml** layout file in Frontend Area. Default xml file will call each page of the website.
app/code/**Vendor**/**Extension**/view/frontend/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="footer_links">
            <block class="VendorExtensionBlockLink" name="footer_link"/>
        </referenceBlock>
    </body>
</page>
```

[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-2.webp)](https://magecomp.com/magento-performance-optimization.html)

**Step 2 :** Now, you need to create a Block File with the name Link.php or you can give any name which is described in the block tag under the default.xml file.
app/code/**Vendor**/**Extension**/Block/Link.php
```
<?php
namespace VendorExtensionBlock;
use MagentoFrameworkAppDefaultPathInterface;
use MagentoFrameworkViewElementTemplateContext;
class Link extends MagentoFrameworkViewElementHtmlLinkCurrent
{
public function __construct(
        		Context $context,
        		DefaultPathInterface $defaultPath,
        		array $data = [])
   	{
        		parent::__construct($context, $defaultPath, $data);
    	}
    	public function toHtml()
    	{
         		return parent::toHtml();
   	 }
    	public function getPath()
    	{
       		 return $this->getData('path');
    	}
     	public function getLabel()
    	{
        		return __('Footer Link');
    	}
}
```

This is how you can add a footer link to your Magento 2 store website.
## Conclusion:
I hope the above solution will help you to add Dynamic Link to Footer in Magento 2. In case of any trouble, let me know in the comment section below and I will be quick to solve it. Also, share it with your Magento 2 buddies.
[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-4.webp)](https://magecomp.com/services/hyva-theme-development/)

**Happy Coding ?**

</body>


---

_View the original post at: [https://magecomp.com/blog/add-dynamic-link-footer-magento-2/](https://magecomp.com/blog/add-dynamic-link-footer-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-10-02 10:53:21 UTC_  
