We’ve got a WordPress to Hugo Exporter for those of you who need to export your WordPress Site to Hugo.
- Converts all posts & pages from WordPress for use in Hugo
- Processes shortcodes
- Converts all
post_contentto Markdown Extra (using Markdownify)
- Converts all
post_metaand fields within the
wp_poststable to YAML front matter for parsing by Hugo.
- Converts all Advanced Custom Fields into front matter in your posts. May be duplicate data, but new keys.
- Metadata is converted markdown.
- All internal URls are converted to relative URLs.
- Exports private posts and drafts. They are marked as drafts as well and won’t get published with Hugo.
- Generates a
config.yamlwith all settings in the
- Automatically adds Hugo aliases, so if you have to restructure redirects are already built in
To set the right expectation, your exported content will be Hugo compatible but will only be a base to work from. All platform changes are inherently difficult, but we’ll get you most of the way there.
Your exported posts and pages will have this data transformed for use with Hugo
- Featured Image
That’s usually a large chunk of most sites. And Hugo and most themes will need this basic metadata.
Custom fields are a different story. All your custom fields will be there, but most themes won’t know what to do with them. You’ll have to translate those somehow. Using your IDE to find and replace field keys names can help.
Advanced Custom Fields users should note that your fields will be stored as if you ran get_fields() on a post. So you’re ready to start theming.
It’s been my experience that it just runs faster. Server speeds and setup can vary wildly. Some hosts have very short max timeouts that will cause the export to fail. Using CLI takes most of the headache away.
You should be running the website on a local WordPress installation.
Usage with a locally hosted WordPress installation
- Download Bugo WP Export CLI Plugin.
- Place plugin zip in
- Unzip the file
- Activate plugin in WordPress dashboard
- In a termainal navigate to your WordPress installation to begin using WP-CLI
- Type in your command. See Command-line Usage below.
wp bugo <subcommand> <directory>
- export - export pages, posts and media library
- posts - exports only posts & pages
- media - exports the media library (preserved directories)
- originals - exports only the original media from the media library
- all - exports posts,pages and the media library
Directory This is your target directory. A new folder containing the export will be created here.
# wp bugo all ~/Desktop
Exports posts, exports posts,pages and the media library to