Warning: Declaration of FEE_Field_Terms::wrap($content, $taxonomy, $before, $sep, $after) should be compatible with FEE_Field_Post::wrap($content, $post_id = 0) in /home/twfs/serverkurabe.com/public_html/blog/wp-content/plugins/front-end-editor/php/fields/post.php on line 0

Warning: Declaration of FEE_Field_Tags::wrap($content, $before, $sep, $after) should be compatible with FEE_Field_Terms::wrap($content, $taxonomy, $before, $sep, $after) in /home/twfs/serverkurabe.com/public_html/blog/wp-content/plugins/front-end-editor/php/fields/post.php on line 0

Warning: Declaration of FEE_Field_Category::wrap($content, $sep, $parents) should be compatible with FEE_Field_Terms::wrap($content, $taxonomy, $before, $sep, $after) in /home/twfs/serverkurabe.com/public_html/blog/wp-content/plugins/front-end-editor/php/fields/post.php on line 0

Warning: Declaration of FEE_Field_Post_Thumbnail::wrap($html, $post_id, $post_thumbnail_id, $size) should be compatible with FEE_Field_Post::wrap($content, $post_id = 0) in /home/twfs/serverkurabe.com/public_html/blog/wp-content/plugins/front-end-editor/php/fields/post.php on line 0

Warning: Declaration of FEE_Field_Post_Meta::wrap($data, $post_id, $key, $ui, $single) should be compatible with FEE_Field_Post::wrap($content, $post_id = 0) in /home/twfs/serverkurabe.com/public_html/blog/wp-content/plugins/front-end-editor/php/fields/post.php on line 0

Warning: Declaration of FEE_Field_Widget::wrap($params) should be compatible with FEE_Field_Base::wrap($content, $data) in /home/twfs/serverkurabe.com/public_html/blog/wp-content/plugins/front-end-editor/php/fields/widget.php on line 0

Warning: Declaration of FEE_Field_Comment::wrap($content) should be compatible with FEE_Field_Base::wrap($content, $data) in /home/twfs/serverkurabe.com/public_html/blog/wp-content/plugins/front-end-editor/php/fields/other.php on line 0

Warning: Declaration of FEE_Field_Term_Field::wrap($content, $term_id, $taxonomy) should be compatible with FEE_Field_Base::wrap($content, $data) in /home/twfs/serverkurabe.com/public_html/blog/wp-content/plugins/front-end-editor/php/fields/other.php on line 0

Warning: Declaration of FEE_Field_Single_Title::wrap($title) should be compatible with FEE_Field_Term_Field::wrap($content, $term_id, $taxonomy) in /home/twfs/serverkurabe.com/public_html/blog/wp-content/plugins/front-end-editor/php/fields/other.php on line 0

Warning: Declaration of FEE_Field_Option::wrap($content, $key, $ui) should be compatible with FEE_Field_Base::wrap($content, $data) in /home/twfs/serverkurabe.com/public_html/blog/wp-content/plugins/front-end-editor/php/fields/other.php on line 0
Google XML Sitemapsで生成されるサイトマップの種類(xmlとgz)について | Sabakura Blog

Google XML Sitemapsで生成されるサイトマップの種類(xmlとgz)について

このブログを含めて、自分が管理しているサイトは原則としてGoogleのウェブマスターツール(WMT)に登録を行っています。あわせて、サイトマップの送信も行っています。

現在は管理しているサイトのほとんどがWordPressサイトになっているため、サイトマップの作成には有名なプラグイン「Google XML Sitemaps」を利用しています。

・Google XML Sitemaps – WordPress Plugins

ただ、このプラグインでは設定により「標準のXMLファイル(拡張子は.xml)」のものと「gz圧縮されたファイル(拡張子は.gz)」の両方を出力することができます。
※どちらかだけを作成することも可能です。

サイトマップファイルの生成

今まではあまり意識せずに両方を出力し、WMTにはgz形式のファイルを送信していましたのですが、ふと「どちらを送信するのが正しいのか?」「それとも両方送信するべきなのか?」「SEO上の効果に差はあるのか」などが気になったので調べてみました。

(もしかしてあまりに当たり前の情報だからなのかもしれませんが)意外とこのことに触れている記事が少なかったので、調べた結果を書いておきます。

gz圧縮について

まず「gz圧縮されたファイル」ですが、これについてはUnix/Linuxにおいて圧縮コマンド「gzip」を使った場合に生成されるファイルです。

このほかよく見られる圧縮形式として「.tar.gz」という形式がありますが、これは複数のファイルをgzipで圧縮したものです。サイトマップの場合は「sitemap.xml」のような単独のXMLファイルを圧縮するため、(.tarのつかない)「.gz」形式になります。

ためしにこのブログのサイトマップのサイズを確認してみたところ、以下のような結果になりました。たしかにgz形式のほうがサイズが明らかに小さくなっています。

  • sitemap.xml:18,342 byte
  • sitemap.xml.gz:2,440 byte

ウェブマスターツールへの登録について

では実際にWMTに送信するサイトマップの形式はどちらが望ましいかです。これについては、じつは「Google XML Sitemaps」の公式ヘルプに答えに近いことが書かれていました。

The “sitemap.xml.gz” is a compressed version of the “sitemap.xml” file. It has the same content, but is significantly smaller than the other one. This helps you and the search engines to save a lot of traffic. Since all search engines support compressed sitemaps, you actually don’t need the “sitemap.xml”, but maybe you or your visitors want to view them from time to time so keeping it doesn’t hurt.

要約すると「どちらの形式で作成しても中身には変わりないが圧縮されたgz形式だとサイズが小さいため、トラフィックの節約になる。すべてのの検索エンジンは圧縮したサイトマップを読み取れるので通常はgz形式で問題ない。ただユーザーが直接サイトマップファイルを閲覧するような場合には.xmlが役立つこともある」というわけです。

なおxml形式で送信したからといってインデックスが遅くなるなどのデメリットがあるというわけではないようです。なお、私は一時期「.xml」と「.gz」を両方ともWMTに送信していたことがありますが、とくに警告を受けたりSEO面で順位に変化も感じられませんでした。

ようするに、通常はサイズの小さいgz形式のファイルを送信していればOKということです。これで安心してサイトマップを送信することができるようになりました。