---
title: "sitemap.xmlファイル構造"
slug: "the-sitemap-xml-file-structure"
abstract: "自動生成sitemap.xmlファイルの構造の概要SXA"
---
# sitemap.xmlファイル構造

SXAは、世界的に承認されたガイドラインに従うサイトマップを自動的に生成します。サイトマップ全般について詳しく知りたい方は、[このGoogleドキュメントのサイトマップに関する記事](https://developers.google.com/search/docs/advanced/sitemaps/overview)や、[サイトマップの作成と提出に関するGoogleドキュメントの記事](https://developers.google.com/search/docs/advanced/sitemaps/build-sitemap)をご覧ください。

サイトマップのエントリーには、loc、lastmod、changefreq、priorityの要素があります。

## 異なる言語ごとの代替リンク

サイトマップに異なる言語のページごとに代替リンクがある場合、リンクは以下の形式で表されます。

<url>
 <loc>http://www.example.com/deutsch/</loc>
 <xhtml:link
 rel="alternate"
 hreflang="en"
 href="http://www.example.com/english/" />
 <xhtml:link
 rel="alternate"
 hreflang="de-ch"
 href="http://www.example.com/schweiz-deutsch/" />
 <xhtml:link
 rel="alternate"
 hreflang="de"
 href="http://www.example.com/deutsch/" />
 </url>

グローバルなベストプラクティスに従うため、SXAは以下の一般的な原則に従っています。

-   2つ以上の言語がある場合は、locで定義された各言語ごとに別々のエントリがあります。
    
-   1ページに対して2つ以上の言語が定義されている場合、x-デフォルトは1つのhreflangに設定されます。例えば:
    
    <xhtml:link rel="alternate" hreflang="x-default" href="http://sxa/contact-us"/>
     <xhtml:link rel="alternate" hreflang="en" href="http://sxa/en/contact-us"/>
     <xhtml:link rel="alternate" hreflang="da" href="http://sxa/da/contact-us"/>
    
-   言語が1つだけの場合、SXAはhrefで言語をリストアップしますが、言語コードはlocに追加されません。
    

## サイト構造の例

以下の例は英語とデンマーク語の両方のサイトを使用しています。

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<urlset xmlns:xhtml="http://www.w3.org/1999/xhtml"
 xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
 <url>
 <loc>https://sxa/en</loc>
 <lastmod>2020-07-18</lastmod>
 <changefreq>daily</changefreq>
 <priority>0.5</priority>
 <xhtml:link rel="alternate" hreflang="x-default" href="https://sxa/" />
 <xhtml:link rel="alternate" hreflang="da" href="https://sxa/da" />
 <xhtml:link rel="alternate" hreflang="en" href="https://sxa/en" />
 </url>
 <url>
 <loc>https://sxa/da</loc>
 <lastmod>2020-07-19</lastmod>
 <changefreq>daily</changefreq>
 <priority>0.5</priority>
 <xhtml:link rel="alternate" hreflang="x-default" href="https://sxa/" />
 <xhtml:link rel="alternate" hreflang="da" href="https://sxa/da" />
 <xhtml:link rel="alternate" hreflang="en" href="https://sxa/en" />
 </url>
 <url>
 <loc>https://sxa/page-da</loc>
 <lastmod>2020-07-19</lastmod>
 <changefreq>daily</changefreq>
 <priority>0.5</priority>
 <xhtml:link rel="alternate" hreflang="da" href="https://sxa/da/page-da" />
 </url>
 <url>
 <loc>https://sxa/page-en</loc>
 <lastmod>2020-07-19</lastmod>
 <changefreq>daily</changefreq>
 <priority>0.5</priority>
 <xhtml:link rel="alternate" hreflang="en" href="https://sxa/en/page-en" />
 </url>
 <url>
 <loc>https://sxa/en/page-multi</loc>
 <lastmod>2020-07-19</lastmod>
 <changefreq>daily</changefreq>
 <priority>0.5</priority>
 <xhtml:link rel="alternate" hreflang="x-default" href="https://sxa/page-multi" />
 <xhtml:link rel="alternate" hreflang="da" href="https://sxa/da/page-multi" />
 <xhtml:link rel="alternate" hreflang="en" href="https://sxa/en/page-multi" />
 </url>
 <url>
 <loc>https://sxa/da/page-multi</loc>
 <lastmod>2020-07-19</lastmod>
 <changefreq>daily</changefreq>
 <priority>0.5</priority>
 <xhtml:link rel="alternate" hreflang="x-default" href="https://sxa/page-multi" />
 <xhtml:link rel="alternate" hreflang="da" href="https://sxa/da/page-multi" />
 <xhtml:link rel="alternate" hreflang="en" href="https://sxa/en/page-multi" />
 </url>
</urlset>