Export Wordpress to Jekyll Github hosting

1. Prereq

on your laptop:

Linux/Windows Subsystem for Linux

apt install php-cli php-xml git ruby-dev nodejs gcc make zlib1g-dev

Note that we don’t install ruby-bundler because in general it’s out of date. We’ll install it later.

Mac

brew install git
brew install node
# rest is for php-cli
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php70

2. Export Wordpress

We start with XML export and convert to Jekyll HTML. I like this method because while not capturing tags or comments and requiring manual upload of images, it doesn’t use server Wordpress plugins that are broken for current Wordpress versions.

  1. Log into your Wordpress dashboard then click: Tools > Export > All
  2. execute Wordpress to Jekyll exporter on your laptop

     gem install bundler
    
     gem install github-pages
    
     cd ~
     git clone https://gist.github.com/522402.git
     mkdir yourname.github.com
     cd yourname.github.com
    
     php ../gist-522402/WordpressExporter.php ../wordpress.xml
    

    You’ll notice lots of .html files in a _posts directory. Note that Drafts and Privates will be in there too!

You’ll need to tweak image references, and you lose tags, but it’s better than converting years of Wordpress posts by hand.

Images/videos/media

There is not a native way to export your Wordpress Media Library (another good reason to ditch Wordpress). I suggest grabbing your images and video using FTP to your Wordpress server. Look at your server provider’s documentation for how to do this.

3. Create Jekyll website

Create a Jekyll website with this easy procedure.

Leave a Comment