Export Cms Pages Magento

1. Export CMS Pages via Admin (Commerce only)

If you’re on Adobe Commerce, you can:

  1. Go to Content > Elements > Pages.

  2. Use the Export option (CSV or XML).

    • This feature is not available in Magento Open Source by default.

Export Cms Pages Magento
Export Cms Pages Magento

2. Export via CLI (for both Open Source & Commerce)

You can use n98-magerun2 (a powerful CLI tool for Magento).

n98-magerun2 cms:page:list –format=csv > cms_pages.csv

3. Export via Database Query

If you have direct DB access:

SELECT * FROM cms_page;

You can export the result into a CSV file from phpMyAdmin or MySQL CLI:

mysql -u user -p -e “SELECT * FROM cms_page;” magento_db > cms_pages.csv

4. Export via Custom Module/Script

If you want more control (e.g., specific fields), you can create a custom PHP script using Magento’s

<?php
use Magento\Framework\App\Bootstrap;

require ‘app/bootstrap.php’;
$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$state = $obj->get(‘Magento\Framework\App\State’);
$state->setAreaCode(‘frontend’);

$collection = $obj->create(‘Magento\Cms\Model\ResourceModel\Page\Collection’);
foreach ($collection as $page) {
echo $page->getId() . “,” . $page->getTitle() . “,” . $page->getIdentifier() . “\n”;
}

Check Also

Export Woocommerce Related Crosssell Upsell Products

Export Woocommerce Related Crosssell Upsell Products

1. Use WooCommerce Built-in Export (limited) Go to WooCommerce → Products → Export. Default fields …