Help needed to finish a Wordpress to Kirby migration script

A small update about this since @texnixe mentioned it in this topic. Itā€™s waaaay more complicated than I thought for a good number of reasons. First I could not find a way to change clickable images to the kirby text syntax.

I thought it would be bad to let html in but that was before I started working with a complicated website that has a lot of posts containing a lot of text formating. To sum it up, sometimes the wordpress editor is doing nonsense and keep some empty html (like center, bold, etc) inside the posts and you can only see them in the code editor. When you make the export to kirbytext, it can completly mess your file and the page will not load. I found old posts with an empty bold html tag adding **** during the export and even more nonsense.

So knowing that, I think that the best ā€œsafeā€ route will be to not convert the html to kirbytext at all. Most of the posts being exported for a conservative purpose, I think thatā€™s for the better to prefer readable and working pages instead of ā€œalmost but not totally exportedā€ files.
Thereā€™s also the topic of the age of the wordpress install. Before wordpress used oembed you had to use a third party embed or the iframe from youtube for example. Cases like this are legion and a real mess.

And thereā€™s another problem with the hyperlinks. Most of the time people use either the basic p=1 model or the /year/month/day/topic model and you canā€™t do this as kirby will believe you are talking about folders. Exporting urls this way creates three subfolders with articles in it and that would make using the kirby panel a nightmare (and letā€™s not talk about folder numbers :fearful: ). What Iā€™m trying to say is that, even if we manage to export correctly the posts, weā€™ll also have to work on a redirection solution for most cases.

So in the end, I think there canā€™t be a single perfect solution to migrate to Kirby. Each wordpress install is different and outside of the recent and well managed wordpress installs with basic content, youā€™ll have to modify the exporter.

Iā€™ll update the topic once Iā€™m done exporting my websites and propose the exporter I used. Maybe we can work on a file with different cases in it and let the user choose what matches his install. Maybe we can also work on an .htaccess for urls.

Anyway, itā€™s going to be a bit longer that I wanted. :smile: