Export CMS Pages Magento

This tutorial explains how to export CMS Pages Magento. Here I am showing how to export CMS pages in Magento 1 in CSV

export-cms-pages-magento

Please also refer how to export static blocks magento 1.

Export CMS Pages Magento

The following script export all cms pages.

Bulk Export CMS Pages

function getCmspages() {

    $pages = Mage::getModel('cms/page')->getCollection();

    foreach ($pages as $page) {

        echo 'Page Id : '.$page->getId().PHP_EOL;
        echo 'Page Title : '.$page->getTitle().PHP_EOL;
        echo 'Page Identifier : '.$page->getIdentifier().PHP_EOL;
        echo 'Page Template : '.$page->getRootTemplate().PHP_EOL;
        echo 'Meta Keywords : '.$page->getMetaKeywords().PHP_EOL;
        echo 'Meta Desc : '.$page->getMetaDescription().PHP_EOL;
        echo 'Content Heading : '.$page->getContentHeading().PHP_EOL;
        echo'Content : '.$page->getContent().PHP_EOL;
        echo'Status : '.$page->getIsActive().PHP_EOL;
        echo 'Layout Update Xml : '.$page->getLayoutUpdateXml().PHP_EOL;
        $storeIds= $page->getResource()->lookupStoreIds($page->getId());

        foreach($storeIds as $storeId){

            $store = Mage::getModel('core/store')->load($storeId);
            echo 'Store Name : '. $store->getName().PHP_EOL;
            echo 'Code : '. $store->getCode().PHP_EOL;
            echo 'Website Id : '. $store->getWebsiteId().PHP_EOL;
            echo 'Group Id : '. $store->getGroupId().PHP_EOL;
            echo 'Sort Order : '. $store->getSortOrder().PHP_EOL;

        }

        echo '-----------------------------------------------'.PHP_EOL;
    }
}

Share this Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *

*