Import/Export from wordpress to tumblr

Today I wanted to import a WordPress blog into my tumblr so I could get rid of that old thing. WordPress has an export function, that’s nice, but tumblr no longer has an import option. I guess spammers took care of that. They do have an API, and some people have written scripts to read the wordpress XML and hit the tumblr API with requests. None of these scripts work very well, so I took one of them and adapted it a little bit.

If you need to do this, feel free to grab this PHP script for your purposes. Beware though that tumblr has a daily post limit (I just hit it, and I can’t even queue posts now or save a draft).

That script is not perfect: It does the basic job of copying posts and back-dating them correctly, but tags are not transferred. It does not screw up your HTML, but it uses the old v1.0 tumblr API, so your password is going to get transferred in clear-text when you do this. My advice would be to change your password after you’re done importing.

To the person I stole the code from: Please, never ever re-implement http_build_query. You’re not a good enough programmer to do it.