How to Add a Favicon for Gatsby Site: The 2026 Pro Guide
If you've ever launched a new project and realized your browser tab still shows that generic purple Gatsby logo, you're not alone. It's the ultimate 'I just finished the tutorial' look. While Gatsby is incredibly powerful for performance, its file-based structure can make simple tasks like adding a favicon for gatsby site feel more complicated than they need to be.
We have all been there: you drop a favicon.ico into the root, refresh three times, and... nothing happens. That is because Gatsby's build process handles assets differently than a standard HTML site. To get a professional result like Stripe or GitHub, you need a strategy that handles multiple resolutions and PWA requirements automatically.
The Best Way: Using gatsby-plugin-manifest
In 2026, the gold standard is still gatsby-plugin-manifest. Why? Because it doesn't just add one icon; it generates a whole suite of sizes for Android, iOS, and desktop browsers. It also creates the manifest.webmanifest file, which is critical if you want your site to be installable as a web app. You can learn more about this in our guide on mastering favicon site.webmanifest.
Step 1: Install the Plugin
First, ensure you have the plugin installed in your project. Most Gatsby starters include it by default, but it's worth checking your package.json.
npm install gatsby-plugin-manifest
Step 2: Configure gatsby-config.js
This is where the magic happens. You need to point the plugin to a high-resolution source image (at least 512x512 pixels). The plugin will then downsample this image into all the required formats during the build process.
When you run gatsby build, look in your public folder. You will see a dozen different PNG files and a manifest file. This automated approach ensures that whether a user is on a high-DPI Mac or an old Android phone, your icon looks crisp. (Pro tip: always use a square PNG for the source to avoid weird stretching).
The Manual Method: Using the Static Folder
Sometimes you don't want the plugin to touch your icons. Maybe you have a very specific, hand-optimized .ico file or an SVG that you want to serve directly. In this case, use the static folder at the root of your project.
Why use the static folder?
Anything placed in the /static folder is copied directly to the /public folder without being processed by Webpack. If you put favicon.ico in /static/favicon.ico, it will be available at yourdomain.com/favicon.ico. This is the 'old school' way, but it works perfectly for simple needs.
Adding the Link Tag
To make it official, you need to tell the browser where the icon is. Since Gatsby uses React, you'll likely use a SEO component or Gatsby Head API to inject the link tag into your HTML head.
Even with these tools, things can go wrong. Here are the three most common issues I see in production environments:
The Cache Trap: Browsers are incredibly stubborn about caching favicons. If you change your icon and don't see the update, you likely need to force a favicon cache clear.
Wrong Path: In the plugin config, the icon path is relative to the project root, not the src folder. Double-check your slashes!
Transparency Issues: If your source image has a background color that matches the browser's dark mode, your icon might 'disappear'. Always test against both light and dark themes.
At the end of the day, your favicon is the 'face' of your tab. Taking ten minutes to set up gatsby-plugin-manifest correctly makes the difference between a site that looks like a hobby project and one that looks like a professional brand. If you need to generate those high-res source images quickly, tools like Mzu favicondl can help you convert your logo into the perfect 512x512 PNG to start the process.
Si alguna vez has lanzado un proyecto y te has dado cuenta de que la pestaña del navegador sigue mostrando ese logo morado genérico de Gatsby, no estás solo. Es la señal definitiva de un sitio sin terminar. Aunque Gatsby es increíble para el rendimiento, su estructura puede hacer que añadir un favicon for gatsby site parezca más difícil de lo que debería.
A todos nos ha pasado: pones un favicon.ico en la raíz, refrescas tres veces y... nada. Esto ocurre porque el proceso de compilación de Gatsby maneja los archivos de forma distinta a un sitio HTML estándar. Para obtener un resultado profesional como el de Stripe, necesitas una estrategia que genere múltiples resoluciones automáticamente.
La mejor forma: gatsby-plugin-manifest
En 2026, el estándar sigue siendo gatsby-plugin-manifest. ¿Por qué? Porque no solo añade un icono; genera todo un conjunto de tamaños para Android, iOS y escritorio. Además, crea el archivo manifest.webmanifest, vital para las PWAs. Puedes leer más sobre esto en nuestra guía sobre favicon site.webmanifest.
Paso 1: Instalar el plugin
Asegúrate de tenerlo en tu package.json. La mayoría de los starters de Gatsby ya lo incluyen.
npm install gatsby-plugin-manifest
Paso 2: Configurar gatsby-config.js
Debes apuntar el plugin a una imagen de alta resolución (mínimo 512x512 px). El plugin se encargará de redimensionarla durante el build.
Al ejecutar gatsby build, verás en la carpeta public varios archivos PNG. Esto asegura que tu icono se vea nítido en cualquier pantalla, desde un Mac Retina hasta un móvil Android antiguo. (Consejo: usa siempre un PNG cuadrado para evitar deformaciones).
El método manual: Carpeta Static
Si prefieres tener el control total y usar un archivo .ico optimizado a mano o un SVG, usa la carpeta static en la raíz de tu proyecto.
¿Por qué usar la carpeta static?
Cualquier cosa en /static se copia directamente a /public sin pasar por Webpack. Es ideal para archivos que no quieres que Gatsby procese.
Añadir la etiqueta Link
Usa la Gatsby Head API para inyectar la etiqueta en el head del HTML.
El caché del navegador: Los navegadores son tercos con los favicons. Si no ves los cambios, intenta limpiar el caché del favicon.
Ruta incorrecta: En la configuración del plugin, la ruta es relativa a la raíz del proyecto, no a la carpeta src.
Modo oscuro: Si tu icono no tiene buen contraste, podría desaparecer en temas oscuros.
Tu favicon es la cara de tu sitio en las pestañas. Usar Mzu favicondl para preparar tu imagen fuente te ahorrará dolores de cabeza y dará a tu sitio Gatsby ese toque profesional que necesita.
새 프로젝트를 배포했는데 브라우저 탭에 여전히 보라색 Gatsby 로고가 떠 있다면, 그건 마치 '방금 튜토리얼을 끝냈습니다'라고 광고하는 것과 같습니다. Gatsby는 성능 면에서 뛰어나지만, 파일 기반 구조 때문에 favicon for gatsby site를 설정하는 일이 생각보다 까다로울 수 있습니다.
우리는 모두 경험해 봤을 겁니다. favicon.ico를 루트에 넣고 새로고침을 연타해도 아무 변화가 없는 상황 말이죠. 이는 Gatsby의 빌드 프로세스가 일반적인 HTML 사이트와 자산을 처리하는 방식이 다르기 때문입니다. Stripe나 GitHub처럼 깔끔한 아이콘을 구현하려면 자동화된 전략이 필요합니다.
가장 좋은 방법: gatsby-plugin-manifest 사용
2026년에도 여전히 표준은 gatsby-plugin-manifest입니다. 단순히 아이콘 하나를 추가하는 게 아니라, 안드로이드, iOS, 데스크톱 브라우저에 맞는 다양한 크기를 자동으로 생성해주기 때문입니다. 또한 PWA에 필수적인 manifest.webmanifest 파일도 만들어줍니다. 자세한 내용은 웹 매니페스트 가이드를 참고하세요.
1단계: 플러그인 설치
대부분의 Gatsby 스타터에는 포함되어 있지만, package.json에서 확인해 보세요.
npm install gatsby-plugin-manifest
2단계: gatsby-config.js 설정
최소 512x512 픽셀의 고해상도 소스 이미지를 지정해야 합니다. 플러그인이 빌드 시 이를 적절한 크기로 리사이징합니다.
캐시 지옥: 브라우저는 파비콘 캐시를 매우 오래 유지합니다. 변경 사항이 안 보인다면 파비콘 캐시 삭제가 필요합니다.
잘못된 경로: 설정 파일의 icon 경로는 프로젝트 루트 기준입니다.
다크 모드 대비: 배경이 투명하지 않으면 다크 모드에서 아이콘이 묻힐 수 있습니다.
파비콘은 사이트의 첫인상입니다. Mzu favicondl을 통해 완벽한 소스 이미지를 준비하고 전문적인 브랜드 이미지를 구축해 보세요.
新しいプロジェクトを立ち上げた際、ブラウザのタブにあの紫色の Gatsby ロゴが残っていることに気づいたことはありませんか?それは「チュートリアルを終えたばかりです」と宣伝しているようなものです。Gatsby は非常に優れたパフォーマンスを誇りますが、そのファイル構造ゆえに、favicon for gatsby site の設定という単純な作業が意外と面倒に感じることがあります。
如果你曾经上线了一个新项目,却发现浏览器标签页上还显示着那个通用的紫色 Gatsby 图标,别担心,你并不孤单。这简直是“我刚看完教程还没改配置”的终极标志。虽然 Gatsby 在性能上非常强大,但其基于文件的结构有时会让添加 favicon for gatsby site 这种简单的任务变得比预想中复杂。