How do I install a favicon?
Step 1. Place a favicon on the site
-
Place a file with the name
favicon
in the site's root directory. Pay attention to recommendations. -
Add the file link in the HTML code of the main site page, in the
head
element.<head> ... <link rel="icon" href="https://example.com/favicon.ico" type="image/x-icon"> ... </head>
Attribute
Description
Possible values
rel
Resource type
icon
;shortcut icon
.
href
File URL
To enter a Cyrillic URL of a favicon, use Punycode. For example, for the address
https://мой-сайт.рф/favicon.ico
, specifyhttps://xn----8sbzclmxk.xn--p1ai/favicon.ico
.type
Data type to be sent. Depends on the file format
image/svg+xml
for SVG format.image/x-icon
orimage/vnd.microsoft.icon
for the ICO format.image/gif
for the GIF format.image/jpeg
for the JPEG format.image/png
for PNG format.image/bmp
for the BMP format.
If the link to the favicon is repeated several times in the HTML code, the robot chooses one of the icons.
-
Check if the favicon is displayed in the browser's address bar when viewing the site pages.
Step 2. Check the if the icon is available for the Yandex robot
-
Make sure that:
- The file is accessible via a direct link (server response 200 OK). Use the Server response check tool.
- The file is not prohibited for indexing, for example, in the
robots.txt
file with the Disallow directive. Check prohibitions not only for the file itself, but also for the file directory.
-
Make changes if necessary.
-
Check if the robot loaded the file. This may happen when the robot visits your site. A few days after adding the favicon to the site, go to Website optimization → Site diagnostics in Yandex Webmaster. If you see a warning about favicon problems in the Possible problems section, follow the instructions:
Error
Solution
The file responds with an HTTP code other than 200 OK
Check the server response. The response should be 200 OK. For other response statuses, see Server response check.
The file redirects to another URL
Incorrect data type
Check the
type
parameter value in the file link. It should match the file format.To make sure the favicon is loaded, follow the link View list of everything being checked by Webmaster and find the favicon warning on the page that opens. If it shows the Everything is OK, it means that the robot processed the file.
Step 3. Check how the favicon is displayed in search results
If the robot downloaded the favicon, it will appear in search results within two weeks. How can a favicon be displayed in Yandex services?