2024-04-02 Update: In the meantime I've started moving my content to Ghost instead of WordPress. We'll look back in a few years and see if I regret my choice?


Summary: I'm trying to export my Eleventy posts to a format that can be imported into WordPress and keep getting an error when I try to build it.

What I Want to Do

TL;DR Get my Eleventy content (blog posts) into whatever format to be able to import them into WordPress, ideally with the title, date posted, and text content intact. Images are secondary at this point.

I've been using Eleventy as the CMS for my blog for a few years now. But I'm not really a developer, I just have a lot of friends who are developers. And so I'm in way over my head whenever it's anything beyond publishing a new post or updating a page. I think a move back to WordPress land in one form or another might help me be able to try random things with my blog like importing and displaying my micro.blog. Which might help me release my dependance on Twitter. But probably not. I just really hate "X".

How I'm Trying to Do It

I'm using Andy Bell's explainer on adding a wp.njk file inside my Eleventy install that is supposed to generate a wp.xml file out the other side. You can see my current implementation of it on GitHub or here if it's not able to build with it in my repo.

The only change I made was where Andy is using for item in collections.items, I thought I should change that to for item in collections.posts since that's where my blog's posts are in /posts/. But I could be wrong there?

Side note: I started using Eleventy based off Andy's excellent starter kit for Eleventy - Hylia. No shade to Andy or his code. I know the error exists between the keyboard and chair on this one.

The Error(s) I Get

When I build it on Netlify, this is what the content of the wp.xml file looks like.

And I get this error message in my Netlify console.

The error from Netlify seems to have a lot more issues than just me trying to add a wp.xml file—but the errors don't show up if I commit without that wp.njk file included.

Help

Any suggestions on how to get my Eleventy content into a WordPress usable format? If you don't already know how to reach me, feel free to find me on Twitter or submit a suggestion on GitHub.

Exporting Eleventy Blog Posts to WordPress Issues

I wish I hadn't moved to a "easy" flat file system for my blog's CMS.