Getting from WordPress to InDesign, part 1

This, I know, is the code a lot of people have been waiting for. It hasn’t been posted till now mostly because I’ve been trying to package everything to make it plug-and-play. At a certain point it was time to give up.

The code isn’t hard to grasp, but it will take some modification to get it to work.

The code is all on Github. Essentially it reads posts from WordPress via XMLRPC and creates InDesign Tagged Text files on a local drive.

I’ve written XMLRPC extenders for WordPress to go with this code. It is also on Github.

The XMLRPC extender simply allows us to query based on a lot more options and return a very full result. The real work is in the import script, and there you’ll have to do some modifications to make it work with your InDesign styles.

For us, this script is running on a server on our local network that everyone here has access to. We let it run every minute by setting up this simple cron job:

*/1 * * * * curl localhost/import.php

You’ll need a folder to store all the files in. By default it’s a directory called files. You’ll need to make sure that has the proper permissions to be written to.

By default all the stories will be saved in that folder named id.txt. We use this to programmatically pull the stories into InDesign, but that plugin isn’t released yet. You might want to consider naming the files using the story title to make it more easily human readable.

The templating process isn’t quite as easy as WordPress’, but if you’re familiar at all with styles and PHP you should be able to figure things out. The code is pretty well documented, I think, but if you have questions please leave them as a comment on this post and I will do my best to respond to all of them.

14 thoughts on “Getting from WordPress to InDesign, part 1”

    1. The script runs off PHP, and we actually had it running on a mac to start. You should be able to as well once you’ve enabled web services and PHP or installed MAMP.

  1. Hi this looks very awesome and for me as a student can help me allot. For my projects i need to keep track of what i did and make a full report of it, needs to have a nice template for it so that i can make it well presented.

    This I do in indesign, but i’me not that good in coding stuff. HTML and CSS are my basic skills and I know a bit of PHP but this really blows my mind. So I wondered if you have had some progress with the plugin yet? I cant wait till its released.

    If this isn’t possible yet could you make me a small (noob) tutorial?

    Hope to here from you,

  2. this sounds awesome! i just stumbled into this today, and i might just need to do something like this for a big project. do you know if there were any updates since this?

  3. Ditto on the updates. I was able to install the other plugins and get my GDrive articles to port over to WordPress (and I know squat about PHP – I was amazed to get that far), so now I’m trying to see if I can do the WP->InDesign to complete this rarely awesome Monday.

    Thanks so much for all your hard work.

  4. Hi, I run a small daily newspaper in Aus … really liking what you’ve done and am considering making the switch …
    My initial questions is about google docs. For our newsroom, do I set up one editorial account, and then get all the journos to access it through one log in … or would they have their own log in to access the one google drive account.

    1. Michael,
      You’d probably want to set your company up to use Google Apps so everybody can get their own company-branded logon. It’s a fantastic service, and it only costs $50/user/year, which is probably pretty comparable to what you’re spending on email right now.


Leave a Reply

Your email address will not be published. Required fields are marked *