WordPress to Lektor Exporter
One-click WordPress plugin that converts all posts, pages, taxonomies, metadata, to contents.lr Markdown files in proper folders which can be dropped into Lektor.
Many shared hosts may use PHP 5.2 by default. WordPress to Lektor Export requires PHP 5.3 or greater.
If you get an error message that looks like
unexpected T_STRING 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.2 lost support from the PHP project itself more than five years ago. You'll need to be running at least PHP 5.3 which adds namespace support (the reason it's breaking), but I'd recommend at least 5.5 (or the latest your host supports) as it's the oldest supported version: https://en.wikipedia.org/wiki/PHP#Release_history
- Converts all posts, and pages, rom WordPress for use in Lektor
- Export what your users see, not what the database stores (runs post content through
the_contentfilter prior to export, allowing third-party plugins to modify the output)
- Converts all
post_contentto Markdown Extra (using Markdownify)
- Outputs Lektor compatible file in exports/ folder within the plugin folder
- No settings. Just a single click.
- Place plugin in
- Activate plugin in WordPress dashboard
- Ensure that the exports folder within the plugin is writeable by webserver
Export to Lektorfrom the
- Check the exports folder for the converted files
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.
If using this method, you must run first
cd into the wordpress-to-lektor-exporter directory.
Alternatively, if you have WP-CLI installed, you can run:
The WP-CLI version will provide greater compatibility for alternate WordPress environments, such as when
wp-content isn't in the usual location.
Custom post types
To export custom post types, you'll need to add a filter to do the following:
add_filter( 'lektor_export_post_types', array('posts', 'pages', 'you-custom-post-type') );
This feature is still in development.
- Initial release
The project is licensed under the GPLv3 or later