How to Migrate from WordPress to Hugo

Why Migrate

  1. WordPress browser-based Markdown editing can be unstable, and content can be lost accidentally. Hugo lets you use local editors for better efficiency.
  2. WordPress media handling often requires upload-first workflows. In Hugo, post files and images can live in the same folder and be referenced directly.
  3. WordPress requires a database + PHP stack and server-side maintenance. Hugo is much lighter.

Migration Steps

Install Hugo

https://gohugo.io/getting-started/quick-start/

Export WordPress posts to Markdown

Use this tool: https://github.com/SchumacherFM/wordpress-to-hugo-exporter

Clone it into wp-content/plugins/ and run:

1
2
3
git clone https://github.com/SchumacherFM/wordpress-to-hugo-exporter.git
cd wordpress-to-hugo-exporter
php hugo-export-cli.php

It generates hugo-export.zip.

After extracting, key parts include:

  • config.yaml: Hugo config template (can be rewritten for your site)
  • posts: exported Markdown posts by date
  • wp-content/uploads: existing media assets from WordPress

Notes on front matter:

  • Exported files include YAML with title/author/time/URL/category/tag.
  • excerpt is not recognized by many Hugo themes directly; rename/use it as description if needed for meta description display.

Organize Markdown files

Put content under /content according to your theme structure and conventions.

Build and Upload

1
2
hugo
rsync -azv public/ root@youre_server_ip:/your/folder/
记录并分享
Built with Hugo
Theme Stack designed by Jimmy