Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.
/ wp_to_contentful Public archive

A small custom utility for parsing my Wordpress XML export and getting into the data model I want for Contentful.

License

Notifications You must be signed in to change notification settings

ohookins/wp_to_contentful

Repository files navigation

Summary

This is just a set of tooling to help me migrate my WordPress blog to Contentful. Probably not very useful for the general case, but I'm documenting how it is used in case I forget.

Prerequisites

You need to have the following installed:

  • dep for go dependency management
  • pandoc (e.g. from homebrew) for HTML to Markdown conversion

Building/Running

dep ensure
go build
./wp_to_contentful -filename <WordpressDump.xml> -space <SpaceID> -token <CMAToken>

The following are created:

  • tags
  • authors
  • categories
  • assets (both images and other attachments)
  • blog posts

Each of the above with exception of assets get their own content type. Posts make use of links to link to the entries for tags/categories/authors rather than duplicating the data directly in the post. The data in these other content types is minimal, but it's better to do it this way for content searching.

Additionally, a Netlify-compatible _redirects file is generated from the renamed paths of posts and assets.

About

A small custom utility for parsing my Wordpress XML export and getting into the data model I want for Contentful.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages