{"id":10846004,"date":"2018-11-04T09:50:08","date_gmt":"2018-11-04T09:50:08","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=helphub_article&p=10846004"},"modified":"2023-01-11T17:29:46","modified_gmt":"2023-01-11T17:29:46","slug":"create-a-favicon","status":"publish","type":"helphub_article","link":"https:\/\/wordpress.org\/documentation\/article\/create-a-favicon\/","title":{"rendered":"Create a Favicon"},"content":{"rendered":"\n

A favicon<\/em> (short for “favorite icon”) is an icon associated with a particular website or web page. It is generally intended to be used when you bookmark a web page. Web browsers use them in the URL bar, on tabs, and elsewhere to help identify a website visually. Favicons are also used as application icons on mobile devices.<\/p>\n\n\n\n

A favicon is typically a graphic 16 x 16 pixels square, and is saved as favicon.ico<\/code> in the root directory of your server. You can use a favicon with any WordPress site on a web server that allows access to the root directories.<\/p>\n\n\n\n

WordPress Version 4.3 or later<\/h2>\n\n\n\n

WordPress Version 4.3<\/a> implemented a Site Icon feature that enables favicons on your web site.<\/p>\n\n\n\n

When you use the Site Icon feature, you don’t need to prepare the favicon.ico<\/code> file by yourself, or modify your template file. All you have to do is navigate to the Customize screen and specify a square image that has a height and width of at least 512 px.<\/p>\n\n\n\n

Later paragraphs in this article contain instructions for manually setting up your own favicon. However, it is highly recommended that you use the Site Icon feature (a feature that is built-in to WordPress) instead.<\/p>\n\n\n\n

Follow the steps below to use Site Icon to set up a favicon for your site.<\/p>\n\n\n\n

  1. Prepare the image file. (It must be square, having a height and width of at least 512 px.)<\/li>
  2. Navigate to Administration Screen<\/a> > Appearance > Customize<\/li>
  3. Click Site Identity<\/strong><\/li>
  4. Click Select Image<\/strong> (located under the Site Icon<\/strong> subheading).<\/li>
  5. Click on the Upload Files<\/strong> tab, then click Select Files<\/strong> to upload the image file that you prepared in the previous step.<\/li><\/ol>\n\n\n\n
    \"customizer-siteicon\"<\/a><\/figure>\n\n\n\n

    Creating a Favicon<\/h2>\n\n\n\n

    A favicon can be created by using any graphics\/image editing software that allows the saving of .ico<\/code> files. There are also online services that will allow you to create a favicon for free.<\/p>\n\n\n\n

    The image should be clear and visually appealing. Ideally it should be designed to match your site’s brand image and\/or content.<\/p>\n\n\n\n

    To prepare the image to be saved as favicon.ico<\/em>:<\/p>\n\n\n\n

    1. Make the image square by cropping or adding space around it.<\/li>
    2. Resize the image to 16 x 16 pixels.<\/li>
    3. Save the file as favicon.ico<\/code>.<\/li><\/ol>\n\n\n\n

      If you’re using an online service to create your favicon (such as Faviconer.com<\/a> or Dynamic Drive<\/a>) follow the instructions provided by the site, and then download the favicon.ico image to your computer.<\/p>\n\n\n\n

      Installing a Favicon in WordPress<\/h2>\n\n\n\n

      If your theme or your WordPress version does not support the Site Icon option described above, you can use this method to manually add a Favicon.<\/p>\n\n\n\n

      If there is already an old favicon.ico<\/code> file in your current theme’s main folder, delete it using an FTP Client<\/a>.<\/p>\n\n\n\n

      1. Use an FTP Client to upload the new favicon.ico<\/code> file into your current theme’s main folder.<\/li>
      2. Upload another copy of your favicon.ico<\/code> file to the main directory of your site (ex. http:\/\/example.com\/favicon.ico<\/code>). This will display the favicon in your subscribers’ feed readers.<\/li><\/ol>\n\n\n\n

        In order for your favicon to show up in some older browsers, you will need to edit your page header. (Remember, the best way to edit your theme’s files is via a Child Theme<\/a>. As you follow along with the following instructions, it is highly recommended<\/strong> that you create and modify the copy of header.php that is located in your child theme.)<\/p>\n\n\n\n

        1. Go to your WordPress Administration Screen<\/a>.<\/li>
        2. Click on Appearance<\/em>.<\/li>
        3. Click on Theme Editor<\/em>.<\/li>
        4. Select the file called Header<\/a> or header.php<\/a> to edit the file.<\/li>
        5. Search for the line of code that begins with <link rel=\"shortcut icon\"<\/code> and ends with \/favicon.ico\" \/><\/code>. Overwrite it, if it exists, or add the following code below the HTML tag:<\/li><\/ol>\n\n\n\n
          <link rel=\"shortcut icon\" href=\"<?php echo get_stylesheet_directory_uri(); ?>\/favicon.ico\" \/><\/code><\/pre>\n\n\n\n

          Save the changes.<\/p>\n\n\n\n

          How to create a favicon with a transparent background<\/h2>\n\n\n\n

          Before implementing this method, please make sure that your source image already has a transparent background, which means it should be a GIF or a PNG. The rest of the steps are as mentioned above. The one difference in the code is that, instead of using a favicon.ico file, use favicon.png or favicon.gif instead.<\/p>\n\n\n\n

          Search for the line of code that begins with <link rel=\"shortcut icon\"<\/code> and ends with \/favicon.ico\" \/><\/code>. Overwrite it, if it exists, or add the following code below the HTML tag:<\/p>\n\n\n\n

          <link rel=\"shortcut icon\" href=\"<?php echo get_stylesheet_directory_uri(); ?>\/favicon.png\" \/><\/code><\/pre>\n\n\n\n

          To see your new favicon, clear your browser’s cache<\/a>. You may need to restart your browser in order to see the new favicon.<\/p>\n\n\n\n

          Advantages of using .ico over .png or .gif<\/h2>\n\n\n\n
          1. Compatibility – As of this writing, most modern browsers<\/a>–except for iOS Safari and Opera Mini–support the .ico format.<\/li>
          2. Avoid 404 server errors – Virtually all modern browsers will request a favicon.ico, so it’s best to always have a favicon.ico file, to avoid a “404 not found” error.<\/li>
          3. An .ico file can hold more than one icon, so there is no need to include multiple files for 16×16 and 48×48 icons.<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"

            A favicon (short for “favorite icon”) is an icon associated with a particular website or web page. It is generally intended to be used when you bookmark a web page. Web browsers use them in the URL bar, on tabs, and elsewhere to help identify a website visually. Favicons are also used as application icons […]<\/p>\n","protected":false},"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","category":[81,80],"class_list":["post-10846004","helphub_article","type-helphub_article","status-publish","hentry","category-appearance","category-customization"],"revision_note":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/10846004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles"}],"about":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/types\/helphub_article"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/comments?post=10846004"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/10846004\/revisions"}],"predecessor-version":[{"id":16355146,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/10846004\/revisions\/16355146"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/media?parent=10846004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/category?post=10846004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}