The simple way
Name the file favicon.ico and put it in the main folder of your website, so it opens at yoursite.com/favicon.ico. Browsers look for it there.
With a link tag
You can also point to it from the head of your pages with a line like this: <link rel=”icon” href=”/favicon.ico” sizes=”any”>. On WordPress, set the Site Icon in the Customizer instead, and WordPress adds the tags for you.
Design tips for small sizes
At 16 pixels there is room for only a letter or a simple shape. Use your logo mark rather than the full logo with text, give it strong contrast, and leave a little space around the edges.
Starting from a non-square image
If your image is wider than it is tall, the tool fits it inside the square and keeps the sides clear. For the best result, crop it to a square first with our crop tool.