Related: Create a Jekyll website from scratch
The examples show GitLab but of course work equally well with GitHub/Bitbucket/etc. I use GitLab instead of GitHub Pages because of GitLab’s unlimited free repos.
- Prereq: on your laptop
apt install php-cli php-xml git ruby-dev nodejs gcc make zlib1g-dev ruby-dev libssl-dev gem update --system
- Export Wordpress site to XML. This method doesn’t capture tags or comments. It requires manual upload of images. But doesn’t use server Wordpress plugins that are broken for current Wordpress versions.
- Log into your Wordpress dashboard then click: Tools → Export → All
- be sure Gems are installed to home directory, NOT system (no sudo) by adding to
# Install Ruby Gems to ~/gems export GEM_HOME=$HOME/gems export PATH=$HOME/gems/bin:$PATH
- 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 username.gitlab.io cd username.gitlab.io php ../gist-522402/WordpressExporter.php ../wordpress.xml
You’ll notice lots of
.htmlfiles in a
_postsdirectory. 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.
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.
- Create a Jekyll website with this easy procedure.