Coding

Magento: How to remove a specific url from Magento sitemap.xml?

First copy file from app\code\core\Mage\Sitemap\Model\Sitemap.php to app\code\local\Mage\Sitemap\Model\Sitemap.php and after add bellow code at line number : 201

 
$collection->addFieldToFilter('identifier',array('neq'=>'coupon-partners'));
 
OR
 
Find bellow code in generateXml() function
 
$changefreq = (string)Mage::getStoreConfig('sitemap/page/changefreq', $storeId);
$priority   = (string)Mage::getStoreConfig('sitemap/page/priority', $storeId);
$collection = Mage::getResourceModel('sitemap/cms_page')->getCollection($storeId);
And replace this code:
 
$changefreq = (string)Mage::getStoreConfig('sitemap/page/changefreq', $storeId);
$priority   = (string)Mage::getStoreConfig('sitemap/page/priority', $storeId);
$collection = Mage::getResourceModel('sitemap/cms_page')->getCollection($storeId);
$collection->addFieldToFilter('identifier',array('neq'=>'coupon-partners'));
 
Then try to generate sitemap again to admin side...

0 Bình luận

Trở về
  • HTML5 Canvas
  • HTML5 Canvas

     The <canvas> element is used to draw graphics, on the fly, on a web page. Draw a red rectangle, a gradient rectangle,...