Importing Content from WordPress

This article will walk you through importing content from WordPress into Agility CMS, for this example, we will be importing posts.

It is important to note that will be different for every WordPress setup, this is just a basic example to give an example of how it can be done.

Screen_Shot_2021-06-10_at_4.38.21_PM.png

Setting up the Content Models in Agility

To start, we'll need to create a Content Model in Agility that will be similar to how the content we have in WordPress is structured. We can do this by going to Models > Content Models. 

Let's start by creating the models for our relations first.

Author Content Model

This model will have a simple title field.

Screen_Shot_2021-06-10_at_4.41.49_PM.png

Category Content Model

This model will have a simple title field.

Screen_Shot_2021-06-10_at_4.45.24_PM.png

Initializing Authors and Categories List

Next, let's initialize the Authors and Categories list so we can reference them in our Post Content Model later. We can do this by going to Content and Initializing the two Lists using the Content Models we just created:

Screen_Shot_2021-06-10_at_4.51.57_PM.png

Screen_Shot_2021-06-10_at_4.49.36_PM.png

 

Screen_Shot_2021-06-10_at_4.49.55_PM.png

Add a sample Author and Category which will help set up the structure of our Excel sheet export later.

Setting up the Post Content Model

Next, let's go back into the Models area to create a Content Model for the Blog Post, this will contain a Title, Slug, Date, and Content field along with Linked Content to our Authors and Categories list.

Here's what the settings will look like for your Authors and Categories Linked Content fields:

Screen_Shot_2021-06-10_at_4.57.23_PM.png

And here's how the Post Content Model will look:

Screen_Shot_2021-06-10_at_5.00.54_PM.png

Just like the Authors and Categories list, we will need to initialize a new List for our Posts using the Post Content Model.

Screen_Shot_2021-06-10_at_5.02.22_PM.png

The Next step is to create a sample post to help with the export of our Excel sheet.

Screen_Shot_2021-06-10_at_5.16.13_PM.png

Once we have a sample post, we can go back to our Posts list and export our list as an Excel sheet in Regular format:

Screen_Shot_2021-06-10_at_5.17.07_PM.png

Screen_Shot_2021-06-10_at_5.18.02_PM.png

When it's finished, you can download the file that's provided to you and open it up. Once it's open, we'll be able to edit the fields in the Post, Author, and Category sheets with the information from our  WordPress post:

Post

Screen_Shot_2021-06-10_at_5.26.05_PM.png

Author

Screen_Shot_2021-06-10_at_5.26.55_PM.png

Category

Screen_Shot_2021-06-10_at_5.27.16_PM.png

*Note: if you would like to import this as New Content as opposed to overriding the test post we created, set the Agility_ContentID values to -1.

Once this is done, you can Import the Excel sheet back into Agility:

Screen_Shot_2021-06-10_at_5.29.02_PM.png

Screen_Shot_2021-06-10_at_5.29.33_PM.png

Once imported, you should see the post in your Posts list:

Screen_Shot_2021-06-10_at_5.32.05_PM.png

Screen_Shot_2021-06-10_at_5.32.17_PM.png

Import/Export Documentation

Getting Started: Import Content

Import and Export from Pages and Content

How to Import Content that contains Child Content

Using the Content Management SDK

Alternatively, you can use the Agility Content Management SDK which is the official JavaScript library for inserting, updating, managing, and importing content, pages, and media in your Agility CMS instance.

Content Management SDK Documentation

 

1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.