GSC sitemap 讀取失敗排查|Could Not Fetch
GSC 顯示 sitemap「無法擷取」是 Nuxt + Cloudflare Pages 專案最常見的 SEO 阻塞問題。這份 SOP 整理根因診斷、production 驗證指令與修復後的 GSC 操作流程。
常見診斷 Map
| GSC 現象 | 優先懷疑 | 檢查方式 | 修正方向 |
|---|---|---|---|
| child sitemap 無法擷取 | child route 404 / HTML fallback / Cloudflare challenge | curl -I + curl -L | custom route、Nitro preset、Content-Type |
| 搜尋結果只顯示英文 | defaultLocale / fallback meta / canonical 指錯 | raw HTML head | i18n SEO composable |
| sitemap 有頁但未收錄 | noindex / 內容薄 / canonical 指錯 | sitemap + head 對照 | 移除矛盾、補內容 |
| 直接貼文章 URL 進 offline | PWA navigateFallback 攔截 | 瀏覽器 SW + curl 對照 | denylist 公開頁 |
| 站內點正常但直接貼 URL 404 | Nuxt Content slug / trailing slash | curl -L URL | slug normalization |
| sitemap URL 回 301 | trailing slash 不一致 | curl -I sitemap loc | sitemap/canonical 改 final URL |
| JSON-LD 混 non-www | siteUrl fallback 值錯誤 | raw HTML grep domain | runtimeConfig / fallback 統一 |
| robots blocked 但 sitemap 包含 | robots / sitemap 設定矛盾 | robots + sitemap grep | exclude 或 robots 調整 |
| 已封鎖但出現在 sitemap | robots.txt Disallow 與 sitemap 矛盾 | 比對兩者 | 必須修,二選一 |
| 替代網頁,有適當 canonical | hreflang / canonical 正常時可接受 | 確認主版本是預期語系 | 通常不需處理 |
Production 驗證指令
Header 檢查
部署後驗證
檢查 redirect 與 sitemap 回應
curl -I https://example.com/curl -I https://www.example.com/curl -I https://www.example.com/robots.txtcurl -I https://www.example.com/sitemap_index.xmlcurl -I https://www.example.com/sitemap.xmlcurl -I https://www.example.com/__sitemap__/zh-TW.xmlcurl -A "Googlebot" -I https://www.example.com/__sitemap__/zh-TW.xml預期結果:
- non-www → 301/308 → www
- www → 200
- robots.txt → 200
- sitemap index → 200 XML
- child sitemap → 200 XML
- Googlebot UA → 200,不被 challenge
- 沒有 HTML fallback 假裝成 sitemap
Body 檢查
確認 SSR 正常
檢查 sitemap 與內容頁真實內容
curl -L https://www.example.com/robots.txtcurl -L https://www.example.com/sitemap_index.xmlcurl -L https://www.example.com/__sitemap__/zh-TW.xml | head -80SSR Head 檢查
確認 metadata 完整
抓取重要頁面 raw HTML 檢查 head
curl -L https://www.example.com/ > seo-home.htmlcurl -L https://www.example.com/ja/ > seo-ja.htmlcurl -L https://www.example.com/en/ > seo-en.html檢查每個檔案應包含:<title>、description、canonical、hreflang、html lang、OG / Twitter、robots meta、JSON-LD、主要內容(不是 loading shell)。
修復後 GSC 操作 SOP
第一次修復部署後
- 提交 canonical sitemap(例如
/sitemap_index.xml)。 - 等待 GSC 顯示 sitemap index 已處理。
- 確認 child sitemap 不再「無法擷取」。
- 對首頁、價格頁、重要文章、重要知識庫頁逐一做「網址審查」。
- 若「即時測試」通過,按「要求建立索引」。
判讀指南
| GSC 現象 | 常見根因 |
|---|---|
| child sitemap 無法擷取 | child route 404、Cloudflare fallback HTML、Content-Type 錯、bot challenge |
| 搜尋結果只顯示英文 | root defaultLocale / fallback meta 是英文、中文頁 canonical 指到英文 |
| 已檢索但未建立索引 | 內容薄、duplicate canonical、noindex/sitemap 矛盾 |
| 替代網頁,有適當的 canonical | hreflang/canonical 正常時可接受,確認主版本是預期語系 |
| 已封鎖但出現在 sitemap | robots/sitemap 設定矛盾,必須修 |
持續追蹤
提交 sitemap 後幾天回看以下指標:
- 已建立索引數量
- 已檢索但未建立索引
- 替代網頁,有適當的 canonical
- 被 robots 封鎖
- 找不到 404
sitemap 成功提交不代表 Google 會立刻重新索引。不要因為幾小時內沒有變化就重複亂改設定。
完成標準
Checklist
GSC sitemap 修復完成
- sitemap index 200 XML(非 HTML fallback)
- child sitemap 200 XML
- Googlebot UA 200,不被 challenge
- sitemap loc 全部使用 canonical domain
- sitemap 不含 noindex / private 路由
- GSC sitemap 狀態為「成功」
- 重要 URL 已做網址審查並要求建立索引