Export Wordpress Content for Statamic

Written by Dave | July 31 2014

As I just found out this same plugin works rather nicely for preparing your content for Statamic as well. The below is pulled directly from the readme ...

Features

  • Converts all posts, pages, and settings from WordPress for use in Jekyll
  • Export what your users see, not what the database stores (runs post content through `the_content` filter prior to export, allowing third-party plugins to modify the output)
  • Converts all `post_content` to Markdown Extra (using Markdownify)
  • Converts all `post_meta` and fields within the `wp_posts` table to YAML front matter for parsing by Jekyll
  • Generates a `_config.yml` with all settings in the `wp_options` table
  • Outputs a single zip file with `_config.yml`, pages, and `_posts` folder containing `.md` files for each post in the proper Jekyll naming convention
  • No settings. Just a single click.

Usage
-----

1. Place plugin in 

/wp-content/plugins/

2. Make sure `extension=zip.so` line is uncommented in your `php.ini`
3. Activate plugin in WordPress dashboard
4. Select `Export to Jekyll` from the `Tools` menu

This will create a zip file containing all of your content files with correctly formated filenames to be dropped into your _content folder.

In the download you will have _posts and wp-content ( if that is where you put your images) folders. 

Upload the contents of `_posts` into your `_content/blog` folder and the contents of `wp-content` into your `assets` folder.

If you add 

RewriteRule ^wp-content/(.*)$ assets/$1 [L,NC,R=302]

to your `.htaccess` the image links should translate correctly.

Filed Under:
  • Html
  • Statamic
  • Wordpress