Magento Programmatically create a cms page

Posted by Damodar Bashyal on May 10, 2013


You can easily create a cms page in magento programmatically. Useful when you need to upload a bunch of pages from csv file. Here I haven't created a csv parser but just a simple code to save a cms page.

My file path: /magento/cms-page.php

include_once 'app/Mage.php';


//Create Static Block
$cmsPage = array(
                'title' => 'My CMS page',
                'identifier' => 'my-cms-page',
                'content' => 'Lorem ipsum dolor sit, amen hte gulocse',
                'is_active' => 1,
                'sort_order' => 0,
                'root_template' => 'three_columns'
                'stores' => array(Mage_Core_Model_App::ADMIN_STORE_ID)


Hopefully it works for you too!!!

not published on website

QR Code: Magento Programmatically create a cms page