Magento が現在の日付をサイトマップの lastmod フィールドに入れるという事実を修正するために。これはクロール率の低下につながります。Sitemap.php ( app/code/local/Mage/Sitemap/Model/Sitemap.php ) の日付を次のように変更しました。
/*
* Generate categories sitemap
**/
$changefreq = (string)Mage::getStoreConfig('sitemap/category/changefreq', $storeId);
$priority = (string)Mage::getStoreConfig('sitemap/category/priority', $storeId);
$collection = Mage::getResourceModel('sitemap/catalog_category')->getCollection($storeId);
foreach ($collection as $item) {
$xml = sprintf('<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>',
htmlspecialchars($baseUrl . $item->getUrl()),
substr(Mage::getModel('catalog/category')->load($item->getId())->getUpdatedAt(),0,10), //---> here the changes
$changefreq,
$priority
);
$io->streamWrite($xml);
}
それはうまくいきますが、私のsitemap.xml(www.edenglamode.com/sitemap.xml)のいくつかのURLでlastmodが空であることに気づいたので、Googleはそれについて不平を言いました。
<url>
<loc>
http://www.edenglamode.com/robe-courte-sexy-bustier-avec-ceinture.html
</loc>
<lastmod/>
<changefreq>hourly</changefreq>
<priority>1.0</priority>
</url>
それを修正するのを手伝ってもらえますか?