How to Import CMS Pages to Magento 2

- E-Commerce, Magento 2

Magento 2 CMS pages are a key part of creating unique and attractive store. Homepage, news blocks, promotions and other content type, you can do everything with CMS pages.

With Improved Import and Export extension you are no longer tied to the store’s backend for editing purposes. You can now import multiple CMS pages to your store in a single click.

In this post we will tell you how to do it.


Guide list

How to Import Magento 2 CMS Pages post continues the line of guides for Magento 2 import/export guide list. The other articles in the line are:


What we will be using

You probably know that native Magento 2 import procedure is limited to products, advanced pricing and customers, so importing CMS pages is not an option. That’s why FireBear team is trying their best to create an import solution that would allow import of all main and complementary entities you may want in your Magento 2.

The solution is Improved Import and Export extension that, with the latest release, brings CMS pages import. Now, just as products, or categories, CMS pages can be added to the store in bulk using CSV or XML tables. The CMS pages complement the other entities available for import such as categories, cart price rules, customers and products.

Buy Improved Import Magento 2 Extension

How to import Magento 2 CMS pages

The CMS pages are imported in a CSV or XML table properly formatted for Magento 2. The formatting includes:

Character set Unicode (UTF-8)
Field separator Comma, Tab
Text delimiter

These are of course basic formatting for CSV and XML. You can always use your own formatting and then set proper separators in the import job. However, we will get to it a bit later.

Creating an import table

We have a properly formatted CSV or XML table, it is now high time to fill it with the columns with CMS page attributes. You can find sample CMS page import table in the Google Sheet Master table.

If you still want to compose the table manually please refer to the following table:

Attribute name Reference Values Value example
creation_time Created (in the CMS pages grid) The date should be in the following format:

yy/mm/dd

17/05/10
title Page Title Any text and symbol value Sample page title
identifier URL Key Lowercase letters and numerals, underscores and dashes allowed sample_page_url
store_view_code Store view The codes of the store views separated by comma.

Use ‘All’ to assign CMS page to All Store Views.

You can get the code of the store view at Stores > All Stores > click the required entity in the Store Views column and find ‘Code’ field.

The value in the ‘code’ field is the store view.

All,default
is_active Enable Page 1 – the CMS page is enabled

0 – the CMS page is disabled

1
content_heading Content Heading Any text and symbol value Sample content heading
content Content Any text and symbol value. Simple HTML is allowed as when creating CMS pages. <p>Hello, world</p>
page_layout Layout 1column – 1 column layout

2columsn-left – 2 column with left bar layout

2columns-right – 2 column with right bar layout

3columns – 3 column

leave empty for empty layout

2columns-left
meta_title Meta Title Any text and symbol value Sample page meta title
meta_keywords Meta Keywords Any text and symbol value sample,meta,keywords,of,the,CMS,page
meta_description Meta Description Any text and symbol value Sample page meta description
layout_update_xml Layout Update XML XML <referenceContainer name=right”>

<action method=”unsetChild”><argument name=”alias” xsi:type=”string”>right.reports.product.viewed</argument></action>

<action method=”unsetChild”><argument name=”alias” xsi:type=”string”>right.reports.product.compared</argument></action>

</referenceContainer>

custom_theme Custom Design Update > New Theme The path to the theme which can be found under Content > Themes > Theme Path (in the gird) Magento/luma
custom_root_template Custom Design Update > New Layout 1column – 1 column layout

2columns-left – 2 column with left bar layout

2columns-right – 2 column with right bar layout

3columns – 3 column

leave empty for empty layout

3columns
custom_theme_from Custom Design Update > From The date should be in the following format:

mm/dd/yy

3/2/19
custom_theme_to Custom Design Update > To The date should be in the following format:

mm/dd/yy

3/29/19

Now, that you have every attribute reference you can manually compose the import table.

Creating an import job

Now that you have your import table ready you can start creating an import job. To do this, log in to your Magento 2 admin panel and navigate to System > Improved Import / Export > Import Jobs.

Here, at the Import Jobs grid you need to click ‘Add New Job’ button.

General Settings

The first set of settings you see are the General settings of the job.

Here you need to specify the Job Title, decide on the job’s schedule and if you are not sure that every job comes with the unique URL – enable Generate Unique Url If Duplicate.

Import Settings

Next comes the Import Settings section where you need to select required import entity.

Click the Entity field dropdown and select ‘CMS Page’ to import CMS pages.

Import Behavior

Then, scroll down to the Import Behavior section.

In this section you need to specify the behavior for the job. Then, decide what Validation Strategy the job should stick to. At last if you didn’t read the chapter Creating and import table and decided to use your custom formatted table, you can set up the separators.

Import Source

After, you are welcomed by the Import Source section.

Here you need to specify the type of the file you will be importing, either CSV or XML. Select the source you will be importing from, including Google Sheets, and either paste the URL or the path to the import table. At last, you need to click ‘Validate file’ button to ask the extension to check the import table for proper formatting.

Map Attributes

The last section to pay attention to is Map Attributes.

Here, if you didn’t follow Creating an import table chapter and used custom attributes for CMS page values, you will need to map you custom attributes with the Magento 2 ones.

You can also select the platform you are importing CMS pages from in the Select A Platform field. This way the extension will load the attribute mapping list automatically.

That’s it for the import job. You can now hit big orange ‘Save and Run’ button at the top-right corner of the screen to start the import process. Improved Import and Export extension will take care of everything else.

Buy Improved Import Magento 2 Extension

If you are interested in guides for importing other entities – check out the dedicated blog articles in the beginning of the post.