この内容は古いバージョンです。最新バージョンを表示するには、戻るボタンを押してください。
バージョン:3
ページ更新者:atom
更新日時:2026-06-11 07:07:02

タイトル: エラー一覧 (sitemap.xml)
SEOタイトル: sitemap.xml エラー総合 — Incorrect namespace / unable to parse XML / URL not allowed

この記事の要点
  • Incorrect namespace: xmlns が http://www.sitemaps.org/schemas/sitemap/0.9 でない
  • unable to parse XML: 不正な文字、未閉じタグ、BOM 付き UTF-8 / 別エンコーディング
  • URL not allowed: sitemap のドメインと記載 URL のドメイン / プロトコルが不一致
  • Sitemap index too large: 1 ファイル 50,000 URL / 50 MB(非圧縮)上限。超えたら index 分割
  • Content-Type: application/xml or text/xml、gzip なら application/gzip

sitemap.xml の標準フォーマット



  
    https://example.com/
    2026-06-10
    daily
    1.0
  

エラー一覧

エラー原因対処
Incorrect namespacexmlns 誤り正しい URI に修正
unable to parse XML構文エラー / BOM / 文字化けUTF-8 (BOM無)、タグ閉じ
Empty sitemap が 0 個URL を 1 つ以上
URL not allowedドメイン / プロトコル不一致sitemap と同 host に
Tag mismatch未閉じ / 重複 タグXML Linter で検出
Sitemap index too large50,000 URL / 50MB 超index 分割
Invalid XML: too many tagsタグ重複1 url 内に loc は 1 個
Invalid datelastmod 形式エラーISO 8601 (YYYY-MM-DD)
Compression errorgzip ヘッダ無しContent-Encoding 設定
HTTP 404 / 500そもそも sitemap.xml に到達できないパス / 権限確認

1. Incorrect namespace








画像 / 動画 / ニュース sitemap は追加 namespace が必要:


  
    https://example.com/post/1
    
      https://example.com/img/1.jpg
    
  

2. Unable to parse XML

XML として読めない。よくある原因と検出方法:

原因確認
BOM 付き UTF-8head -c 3 sitemap.xml | xxd → ef bb bf
Shift_JIS / EUC-JPfile sitemap.xml
未エスケープの &, <amp ; → & に
未閉じタグxmllint --noout sitemap.xml
制御文字cat -v で表示
# 検証
xmllint --noout sitemap.xml
# OK なら何も出ない、NG なら行番号付きでエラー

# Schema 検証
curl -O https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
xmllint --schema sitemap.xsd --noout sitemap.xml

# BOM 削除(Linux/macOS)
sed -i '1s/^\xEF\xBB\xBF//' sitemap.xml

# Windows PowerShell で BOM 無し UTF-8 で出力
Get-Content sitemap.xml | Out-File -Encoding UTF8NoBOM sitemap.xml

3. URL not allowed

sitemap.xml に書かれた URL のドメインが、sitemap 自体のドメインと違う場合に出ます:




https://anotherdomain.com/page


http://www.example.com/page



http://example.com/page



https://example.com/page

4. Sitemap index too large

1 sitemap には50,000 URL まで / 非圧縮で 50 MB まで。超えるなら sitemap index で分割:




  
    https://example.com/sitemap-posts-1.xml
    2026-06-10
  
  
    https://example.com/sitemap-posts-2.xml
    2026-06-10
  
  
    https://example.com/sitemap-products.xml
    2026-06-10
  

5. lastmod の形式


2026-06-10
2026-06-10T12:34:56+09:00
2026-06-10T12:34:56Z


2026/06/10
令和8年6月10日

6. Content-Type / gzip 圧縮

# nginx
location = /sitemap.xml {
    types { application/xml xml; }
    default_type application/xml;
}

location = /sitemap.xml.gz {
    types { application/gzip gz; }
    default_type application/gzip;
    add_header Content-Encoding gzip;
}
# Apache .htaccess
AddType application/xml .xml
AddType application/gzip .gz

# gzip 配信の Content-Encoding 自動付与

  Header set Content-Encoding "gzip"

7. Google Search Console での確認

  1. Search Console → 該当プロパティ → サイトマップ
  2. 新規 sitemap を追加 (例: sitemap.xml)
  3. ステータスを確認: 「成功」 / 「取得できませんでした」 / 「エラー」
  4. エラー内容を展開して該当 URL を確認

「取得できませんでした」はrobots.txt で sitemap を disallow していることが原因のことが多い。

# robots.txt
User-agent: *
Disallow: /admin/

# sitemap.xml は allow されている必要あり
Sitemap: https://example.com/sitemap.xml

8. IIS で Content-Type が正しくない



  
    
      
      
      
      
    
  

FAQ

Q: sitemap.xml は必須?
A: 必須ではないが、新規サイト / 動的に増えるサイト / リダイレクト多いサイトでは強く推奨。Google にクロールヒントを渡せる。

Q: sitemap を更新したら Google にすぐ反映される?
A: いいえ。クロール優先度はクロール頻度・サイトの権威性に依存。Search Console から「再送信」できますが即時反映ではない。

Q: prioritychangefreq は意味ある?
A: Google はほぼ無視すると公式表明。lastmod は読まれる。priority/changefreq は省略してよい。