I have manually created robots.txt file and pasted it in the Magento root folder. when I search for robots.txt file in the browser, It's not showing favicon icon. I thought I have missed something, but when I look for other text files which are pasted in the Magento root folder, that is also not showing favicon icon.

Could you please clarify and help me to display favicon icon for text files?

Your help will be greatly appreciated. Looking forward to your reply.


2 Answers 2


Adding a custom favicon in Admin

  1. Navigate to CONTENT >> Design >> Configuration.
  2. In the scope grid, decide on which level you will configure the favicon and click Edit in the corresponding row.

  3. Under the Other Settings title, expand the HTML Head options.
  4. Next to Favicon Icon, click Upload, and select the file.

  5. Click Save Configuration in the upper right corner to save the changes.

Add custom favicons manually

To override the default 16px x 16px favicon manually, add your custom favicon.ico in the /Magento_Theme/web/directory.

  1. Add your icons in the <your_theme_dir>/Magento_Theme/web/ directory.
  2. In the <your_theme_dir>/Magento_Theme/layout/default_head_blocks.xml layout file specify the paths to the icons and their sizes.
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
       <link src="Magento_Theme::favicon-32x32.png" rel="icon" sizes="32x32" />

For your changes to be applied, clear the browser cache, and the following directories on the server (do not delete the .htaccess file!):

  • pub/static
  • all directories under var

You can just upload favicon icon from the admin backend and it is default allowed some file types only like JPG, GIF, PNG, ICO, APNG and maximun file size is 2MB.

Admin path : Admin -> Content -> Design -> Select your theme (Edit) -> HTML Head -> Upload image on (Favicon Icon) -> Save configuration.

Then just cache flush and check.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.