Skip to content
Migration from WordPress to Hugo

Migration from WordPress to Hugo

July 16, 2026

I will show you a fast and easy migration path from WordPress to Hugo:

Use the Hugo Quick start to create your first Hugo project.

Export everything from WordPress:

Screenshot of export from WordPress
Export from WordPress

You should get something like domaintld.WordPress.YYYY-MM-DD.xml. With this file you can use lonekorean/wordpress-export-to-markdown.

I’ve installed this one on my local machine:

1
2
3
git clone https://github.com/lonekorean/wordpress-export-to-markdown.git
cd wordpress-export-to-markdown
npm install

Now you can convert WordPress to Markdown und download all images:

1
2
3
4
5
npx wordpress-export-to-markdown \
--input domaintld.WordPress.YYYY-MM-DD.xml \
--post-folders true --prefix-date true \
--save-images all \
--wizard false

You should get something like this:

        • index.md
        • index.md
        • index.md
        • index.md

Those index.mds are your posts. They are already formatted. You can copy them to your Hugo project folder.

If you like to, you can rename the index.mds based on the post name. IMHO it is the cleaner option:

1
2
3
4
5
find . -name index.md|while read line
do
    new=$(dirname $line | cut -d"/" -f2)
    mv $line ${new}.md
done

Move them to content/blog and start the hugo server. Now you should see a first impression of your new homepage build with Hugo. From here on you can tweak your appearance.

E.g. placing your homepage directly under / in content/blog/_index.md (notice the _):

_index.md
1
2
3
4
5
6
+++
title = "My Thoughts"
date = 1970-01-01T00:00:00
draft = false
url = "/"
+++

Adding a menu in hugo.toml:

hugo.toml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[params.navbar]
displayTitle = false
displayLogo = true

  [params.navbar.logo]
  path = "logo.gif"
  link = "/"
  width = 110
  height = 55

[[menu.main]]
name = "Home"
pageRef = "/"
weight = 1

[[menu.main]]
name = "Downloads"
pageRef = "/downloads"
weight = 2

[[menu.main]]
name = "Search"
weight = 4

  [menu.main.params]
  type = "search"

[[menu.main]]
name = "More"
identifier = "more"
weight = 3

[[menu.main]]
identifier = "pp"
name = "Privacy Policy"
parent = "more"
pageRef = "/privacypolicy"