Unityアセットストアセール中!

Google Sitemap Generator for WordPressをモバイルサイトマップに対応させる修正方法

<景品表示法に基づく表記 > 本サイトのコンテンツには、商品プロモーションが含まれている場合があります。
スポンサードリンク

Google Sitemap Generator 3.2で検証しました。
モバイル サイトマップの作成 – ウェブマスター/サイト所有者 ヘルプに仕様をあわせます。

xmlns:mobile=”http://www.google.com/schemas/sitemap-mobile/1.0と

が足りていませんので、追加修正します。

Google Sitemap Generatorのsitemap-core.php 1672行目 

$this->AddElement(new GoogleSitemapGeneratorXmlEntry('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'));

$this->AddElement(new GoogleSitemapGeneratorXmlEntry('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"  xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0">'));

に置き換えます。

Google Sitemap Generatorのsitemap-core.php 405行目

$r.= "t</url>n";

の一行前に

$r.= "tt<mobile:mobile/>n";

を追加します。

追加した後はWordPressの管理画面からSitemapの再構築をします。

スポンサードリンク
[WordPressのライティング向けプラグイン]
ワードプレスオリジナルプラグイン >>

この記事が気に入ったら
フォローしてね!

よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!

この記事を書いた人

スポンサーリンク

コメント

コメント一覧 (2件)

WordPressでブログを作成してからやることのまとめ | 米屋のプログラマーのメモ帳 へ返信する コメントをキャンセル

目次
閉じる