Skip to content

CMS Page Import / Export

Recreating CMS pages by hand — across store views, between staging and live, or after a rebuild — is slow and error-prone. CMS Page Import / Export turns every page into a row in a plain CSV: export the lot, edit in a spreadsheet or version them in git, then import to create or update pages in place. It carries the full HTML, the SEO metadata, the page layout and the store-view scope — and sanitises HTML on the way in, so an import can’t smuggle script onto your storefront.

Import CSV and Export CSV buttons on the CMS Pages grid

Install CMS Page Import / Export with Composer using your AgenticEcom licence key (find it on your My Licences page — one key unlocks every module you own):

Terminal window
# 1. Register the AgenticEcom repository (once per store)
composer config repositories.agenticecom composer https://repo.agenticecom.net
composer config --global --auth http-basic.repo.agenticecom.net <YOUR-LICENCE-KEY> x
# 2. Require this module
composer require agenticecom/module-cms-page-import-export
# 3. Apply it
php bin/magento setup:upgrade && php bin/magento setup:di:compile && php bin/magento cache:flush

Magento

Open Source 2.4.9 GA (and later 2.4.x).

PHP

Tested on 8.4 and 8.5.

Format

RFC-4180 CSV — opens cleanly in Excel, Numbers or git.

Scope

Per store view, with safe HTML sanitisation on import.

The buttons only appear once the feature is enabled (it is on by default after install).

  1. Go to Stores → Configuration → AgenticEcom · SEO & Content → CMS Page Import / Export.

  2. Set Enable Import / Export to Yes (the default) and Save Config.

  3. Open Content → Elements → Pages. You’ll now see Import CSV and Export CSV buttons at the top of the grid.

  1. On Content → Elements → Pages, click Export CSV.

  2. Choose the store scopeAll Store Views, or a single store view.

  3. Download the file. Every page in scope is written as one row, with its HTML content, metadata, layout and store assignment.

  1. Click Import CSV and upload your file.

  2. Choose the target store scope for the import.

  3. Choose a behaviour:

    • Add / Update (default) — pages are matched by identifier within the scope and updated in place; new identifiers are created.
    • Add only — new pages are created; existing identifiers are skipped (no error).
  4. Confirm. You get a per-row summary — created, updated and skipped counts, plus any per-row warnings. One bad row never aborts the whole import.

A header row names the columns; order doesn’t matter (they’re matched by name).

ColumnRequiredNotes
identifierThe upsert key — unique per store scope (e.g. about-us).
titlePage title.
is_active1/0 or yes/no.
storesPipe-separated store codes (default|fr|es) or all.
contentThe page HTML (quoted cell).
content_headingOptional heading.
page_layout1column, 2columns-left, 2columns-right, 3columns, cms-full-width or empty.
meta_title / meta_keywords / meta_descriptionSEO metadata.
sort_orderInteger; default 0.

XSS-safe import

On import, <script> tags, inline on* event handlers and javascript: URLs are stripped — a CSV can’t inject executable code onto your storefront.

Layout preserved

Legitimate markup survives: <style>, Page Builder data-* attributes and video <iframe> embeds are kept, so your pages still render as designed.

Per-row resilience

Every row is attempted independently. A malformed row is reported and skipped — it never aborts the rest of the import.

Admin-only

Import/export is gated behind the AgenticEcom_CmsPageImportExport::manage permission. There is no public API surface.

What happens if I import the same file twice?

Pages are matched by identifier within the chosen store scope, so a second import updates those pages in place rather than creating duplicates — one identifier per scope maps to one page.

Can I move pages from one store view to another?

Yes. Export from store A, then import choosing store B as the target scope. You can also target multiple store views from a single file using the stores column (default|fr|es, or all).

What HTML is removed for security?

<script> blocks, inline event handlers (onclick=…, onload=…) and javascript: URLs are stripped on import. Layout HTML — <style>, Page Builder data-* attributes and YouTube/Vimeo <iframe> embeds — is preserved.

Where do page images go?

Upload them to pub/media/cmspages/ and reference them by URL in your page HTML (e.g. /media/cmspages/banner.jpg). The CSV carries the HTML and the URLs, not the image binaries.

Is there an API for this?

No — it’s an admin tool by design, with no public REST or GraphQL endpoint, so it can’t be driven by an untrusted client. Verified clean on Magento 2.4.9, PHP 8.4 and 8.5.