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.


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.


Category Content Model

This model will have a simple title field.


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:





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:


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


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


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


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:



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:







*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:



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



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



Please sign in to leave a comment.