Magento 2

How to Add Custom Favicon in Magento 2 Using Layout XML File

  By     |   March 7th, 2018

Here is the example of adding custom favicon in your magento 2 store using layout xml.
Upload your custom favicon in app/design/frontend/VendorName/themedir/web/images folder

create default_head_blocks.xml with below content and upload to file inside app/design/frontend/VendorName/themedir/Magento_Theme/layout/ directory

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <link rel="icon" sizes="32x32" src="images/favicon-32x32.png"/>
    </head>
</page>

 

favicon-32×32.png will be your new favicon name.
After upload, clear your magento cache, delete files under pub/static and var directories (don’t delete .htaccess file)
Make sure the newly uploaded files have correct file permission.

Want to build your own eCommerce or enhance your eCommerce website features ?

Contact us now for free consultation

Contact Us
RECENT COMMENTS