{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreic5jbz76zvxha3ff2bpz7s7xvnmug6bfd6mz4xrj4vpc4loj6id44",
    "uri": "at://did:plc:svkyjirwpd7ts4qgnzoqfcc2/app.bsky.feed.post/3moih3dhcritk"
  },
  "coverImage": {
    "$type": "blob",
    "ref": {
      "$link": "bafkreigky4sc74up74je7srnxdnjcsvwhy6qs3qqhg734jrkgeiokhnupy"
    },
    "mimeType": "image/jpeg",
    "size": 135463
  },
  "description": "Moving content from WordPress to a static site often means wrestling with complex command-line syntax. We found a cleaner way: using Inquirer.js to streamline the entire export process into one simple, interactive command.",
  "path": "/2025/01/17/inquirer-js/",
  "publishedAt": "2025-01-17T15:47:02.000Z",
  "site": "at://did:plc:svkyjirwpd7ts4qgnzoqfcc2/site.standard.publication/3mhpwfentz6lr",
  "tags": [
    "Code"
  ],
  "textContent": "An increasing number of posts appears to be focusing on how to get content *out* of WordPress. Lol. Well needs must etc. Last time we looked at styles. So this week how about some content wrangling? The goal is to get the WordPress page/post content into our Eleventy instance for processing. Firstly 11ty/import basically just does this wooo. Now that’s a great option, but we might want a little more control over the output, maybe we want to get some ACF fields or some post meta for example, or do some data manipulation. I saw this blog post at some point Taking WordPress to Eleventy from Josh which used a custom WP-CLI command `wp wptomd /path/to/output` and does a bunch of stuff around cleaning and processing the data. Here is the git repo. Now this is great for our needs, it queries the WordPress instance for the selected post type and structures the Markdown metadata format, permalink, title, date, etc. So this is where we could maybe add Computed Data here for example if we wanted to extract some post meta. I edited the plugin a little for my own needs, but mostly it’s the one that Josh built. So effectively we have two commands now: Eleventy npx @11ty/import wordpress example.com --format=markdown --output=dist WP-to-MD wp wptomd /folder/ --post_type=page --file_type=md Nice. Both build out a folder of markdown of html files for our browsing pleasure. However, I wanted this to be bit more configurable so I don’t have to remember all the syntax for the various commands for each import/export method. At some point I stumbled on this post from Bob Monsour – The node CLI scripts of my dreams, about something called Inquirer.js. This was exactly what I needed, via the command line I could simply run `npm run inquirer` and run through a bunch of options to configure my export. It’s also really fun. Here is the code in full. And a little video showing us the goodness. This runs and spits out our content of choice in a specified folder for Here is the output of one of the markdown files for the wp-to-md process. --- title: \"Sample Page\" layout: \"layouts/markdown.njk\" excerpt: \"\" date: 2025-01-06 16:05:57 modified: 2025-01-06 16:05:57 file_type: md permalink: sample-page.html tags: [] featured_img: wpid: 2 --- # Sample Page This is an example page. It’s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this: > Hi there! I’m a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin’ caught in the rain.) …or something like this: > The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community. As a new WordPress user, you should go to [your dashboard](http://) to delete this page and create new pages for your content. Have fun! So there we are, via one command to rule them all where I can get a bunch of content for reuse, recycle, reduce.",
  "title": "Inquirer.js",
  "updatedAt": "2026-05-15T10:53:41.000Z"
}