We'll create fresh WordPress site with Jekyll Exporter installed. You have 20 minutes to test the plugin after that site we'll be deleted.
the_content filter prior to export, allowing third-party plugins to modify the output)post_content to Markdownpost_meta and fields within the wp_posts table to YAML front matter for parsing by Jekyll_config.yml with all settings in the wp_options table_config.yml, pages, and _posts folder containing .md files for each post in the proper Jekyll naming convention/wp-content/plugins/ folderExport to Jekyll from the Tools menuTo report a security vulnerability, please email [email protected].
If you’re having trouble with your web server timing out before the export is complete, or if you just like terminal better, you may enjoy the command-line tool.
It works just like the plugin, but produces the zipfile on STDOUT:
`
php jekyll-export-cli.php > jekyll-export.zip
`
If using this method, you must run first cd into the wordpress-to-jekyll-exporter directory.
Alternatively, if you have WP-CLI installed, you can run:
`
wp jekyll-export > export.zip
`
The WP-CLI version will provide greater compatibility for alternate WordPress environments, such as when wp-content isn’t in the usual location.
To export custom post types, you’ll need to add a filter to do the following:
`php
add_filter( ‘jekyll_export_post_types’, function() {
return array(‘posts’, ‘pages’, ‘you-custom-post-type’);
});
`
The custom post type will be exported as a Jekyll collection. You’ll need to initialize it in the resulting Jekyll site’s _config.yml.
sudo apt-get updatesudo apt-get install composersudo apt-get install php7.3-xmlsudo apt-get install php7.3-mysqlsudo apt-get install php7.3-zipsudo apt-get install php-mbstringsudo apt-get install subversionsudo apt-get install mysql-serversudo apt-get install php-pearsudo pear install PHP_CodeSniffergit clone https://github.com/benbalter/wordpress-to-jekyll-exportercd wordpress-to-jekyll-exporterscript/bootstrapscript/setupscript/cibuild<h3>Testing locally via Docker</h3>
1. git clone https://github.com/benbalter/wordpress-to-jekyll-exporter
2. docker-compose up
3. open localhost:8088
Many shared hosts may use an outdated version of PHP by default. WordPress to Jekyll Export requires PHP 5.6 or greater.
If you get an error message that looks like unexpected T_STRING, unexpected '[' or expecting T_CONSTANT_ENCAPSED_STRING, you need to update your PHP version. In a shared hosting environment, you should be able to change the version of PHP used by simply toggling the setting in the host’s control panel.
PHP 5.4 lost support from the PHP project itself in 2015. You’ll need to be running at least PHP 5.5 which adds namespace support (the reason it’s breaking), but I’d recommend at least 7.3 (or the latest your host supports) as it’s the oldest supported version.
If you are using a shared hosting environment, upgrading to a newer version of PHP should be a matter of changing a setting in your host’s control panel. You’ll have to follow your host specific documentation to determine how to access it or where the setting lives. Check out this list of common hosts for more details.