Apollo Editor
Windows 10 & 11 Buy now · $69.95
Design & SEO

How to Add a Favicon and Social Sharing Tags to Your Website

Add a favicon, Apple touch icon and Open Graph sharing tags to your website so it looks right in browser tabs and when links are shared.

Updated 5 minute read The Apollo Editor team

To add a favicon, create a small square icon file, upload it to your site, and add a <link rel="icon"> tag pointing to it inside the <head> of every page. A good basic set is a 32 by 32 pixel PNG or ICO for browser tabs, a 180 by 180 pixel PNG for Apple devices, and optionally an SVG version. For nice-looking shared links, add Open Graph tags such as og:title and og:image as well.

This guide covers which icon files to make, the exact tags to add, how to set up social sharing images, and how to fix a favicon that will not show.

What a favicon is and where it appears

A favicon is the small icon that identifies your site. Visitors see it in browser tabs, bookmarks and history lists, on phone home screens when someone saves your site, and next to your pages in some search results. Without one, browsers show a generic blank icon, which makes your site harder to spot among open tabs.

Favicons are shown very small, often only 16 pixels across. A simple mark, such as a letter, a symbol or a cropped part of your logo, usually works better than a full logo with words.

Which favicon files you need

You do not need dozens of sizes. A small set covers nearly every browser and device:

FileSizeUsed for
favicon.ico or favicon-32.png32 x 32 (an ICO can also contain 16 x 16)Browser tabs and bookmarks, older browsers
favicon.svg (optional)ScalableSharp icons at any size in browsers that support SVG favicons
apple-touch-icon.png180 x 180iPhone and iPad home screens
A larger PNG (optional)For example 192 x 192Other home screens and search result icons

Chrome, Edge and Firefox have supported SVG favicons for years, but Safari only added support recently, so keep a PNG or ICO alongside any SVG. Every icon should be square.

For Google Search, the favicon must be square and at least 8 by 8 pixels, and Google recommends something larger than 48 by 48 pixels so it looks good everywhere. Google picks up the icon from your home page and shows one favicon per hostname.

How to add the favicon tags

  1. Create the icon files in an image editor or favicon generator, using the sizes above.
  2. Put them in your site folder. The root folder (next to index.html) is simplest. Some browsers look for /favicon.ico at the root even without a tag.
  3. Add these lines inside <head> on every page:
  • <link rel="icon" href="/favicon.ico" sizes="32x32">
  • <link rel="icon" href="/favicon.svg" type="image/svg+xml">
  • <link rel="apple-touch-icon" href="/apple-touch-icon.png">

If you only have a PNG, one line is enough: <link rel="icon" type="image/png" href="favicon-32.png">. Paths starting with / point to the root of your website on a server. If you preview pages straight from your hard drive, or your site lives in a subfolder, use relative paths instead, such as favicon.ico or ../favicon.ico.

Keep the favicon URL stable once it is live. Changing it often means browsers and search engines keep showing the old one for a while.

How to add social sharing tags (Open Graph)

When someone shares your page in a social network or messaging app, the app builds a preview card with a title, short description and image. You control that card with Open Graph meta tags in the <head>:

  • <meta property="og:title" content="Wedding Cakes in Austin">
  • <meta property="og:description" content="Custom wedding cakes with free tastings and delivery.">
  • <meta property="og:image" content="https://www.example.com/images/share-cakes.jpg">
  • <meta property="og:url" content="https://www.example.com/wedding-cakes.html">
  • <meta property="og:type" content="website">

Some platforms also read <meta name="twitter:card" content="summary_large_image"> to show a large image, and use the Open Graph tags for everything else.

Tips for the sharing image

  • Use a full absolute URL starting with https://. Relative paths often do not work in og:image.
  • Use a wide image. Facebook recommends at least 1200 by 630 pixels (about 1.91 to 1) for the best display on high-resolution screens.
  • Keep key content in the middle. Some apps crop the edges or show a square version.
  • Use JPEG or PNG for the widest support across apps, and keep the file reasonably small.
  • Give each important page its own title and description so shared links are accurate.

Troubleshooting icons and sharing previews

  • Caching. Browsers hold on to favicons for a long time. Open the site in a private window, or clear the browser cache, before assuming something is wrong.
  • Wrong path. Open the icon's address directly in the browser. If you get a 404 error, fix the path or upload the file.
  • Tag on one page only. The link tag needs to be in the head of every page, not just the home page.
  • Case sensitivity. Favicon.ico and favicon.ico are different files on many servers.
  • Old sharing previews. Social platforms cache link previews too. Many offer a debugging or preview tool that fetches the page again.
  • Search results. Google needs to recrawl your home page before a new favicon appears in search, which can take some time.

The easier way: favicon and sharing tags in Apollo Editor's Page Properties

Instead of copying head tags into every file by hand, Apollo Editor keeps these settings together in one place.

  • Set the favicon in File > Page Properties, alongside the page title and meta description.
  • Fill in social sharing metadata in the same dialog, so shared links get the right title, description and image.
  • Add anything extra, such as an Apple touch icon line, through the custom head markup field.
  • Use Site Explorer to keep icon files organized with relative paths, and find and replace across files to update tags on every page.

The result is ordinary HTML in each page's head, which you can check in Code mode. Related guides: how to write titles and meta descriptions, which image format to use and why website changes are not showing.

Frequently asked questions

What size should a favicon be?

Provide a small square icon such as 32 by 32 pixels plus larger versions, for example 180 by 180 for Apple devices, or use an SVG favicon.

What is an Open Graph image?

The picture social networks and messaging apps show when someone shares your page, set with the og:image meta tag.

Why is my favicon not showing?

Browsers cache favicons heavily. Check the path in the link tag, then try a private window or clear the browser cache.

Get three guides like this every month, plus software update notices.Subscribe →