Export Wordpress to Hugo

Hello,

I am trying to export 2 blogs with several hundred pages each into Hugo. I have tried the plugins in the Migrate to Hugo page. Yet, they export all posts / pages, without taking into consideration the hierarchy, some pages being children of others.

I am wondering if someone has already faced such a problem and has a solution.
Thanks

Nope, no experience. Only thing I know: if you have the permalink in your export, you can use that as the ‘url’ in your frontmatter, which could give you some ‘hierarchy’.

I don’t remember if I included hierarchy in

but if you have already tried that approach and it doesn’t, I could try to add it into the project.

It’s a little different the PHP exporter, in that it takes an XML export file and processes that. The most effective way to use it is to run it while the original WordPress site is still active, so that it can download the images, in the correct directories, for the conversion process.

It’s been a while since I did my conversion, so I don’t remember quite what I ended up with.

Sorry I can’t be more specific, but hopefully if I dig out my old XML files and image directories, I can update the script, if it doesn’t meet your needs, if it’s not already sufficient.

Hi @jeremie

I’ve moved a lot of pages to Hugo, including a big news site’s blog. The WordPress urls must be properly constructed. For example, if your website example.com includes a blog at example.com/blog and a post utilizes example.com/5-tips-for-something, the hierarchy cannot be taken into account because there is none.
( an extra example: example.com/blog/5-tips-for-something includes /blog/ )

There is also a wordpress plugin that transforms all data to JSON, and you can use the jmooring’s technique to create a custom layout to fetch data to produce all pages with your new design or theme. Hugo new command - #9 by jmooring

I hope you found this information useful.

Thanks

1 Like