Would like to be able to export all posts and their embedded media into a well-formed XML document - or even better, a Word document. I need all posts in date order. Posts have pictures included from the media library; some posts use the [gallery] shortcode, so the export should be able to get those pictures also.

I have tried the standard WP Tools Export, of all data, and just of posts. That creates the XML file, but still need to get that into an editable Word document. I have also tried the WP All Export plugin, but it's XML output is not 'well-formed' (according to the WordPress2Doc program, which apparently handles only the standard WP Export XML format).

I have tried WordPress2Doc standalone program, but it is unable to handle [gallery] images properly. (Have communicated with the WordPress2Doc author, and provided a sample XML export, but his program cannot process the images properly.)

The ultimate intent is to get all posts into an editable Word document, with 'internal' pictures (not links to pictures), to produce a printed book.

I can build a bare-bones template that will use the WP Loop to output all posts/images to an HTML page, but that doesn't give me a standalone Word doc.

Have spent a lot of time asking the googles, to no avail.

How can I convert posts, including images, into an editable document?


Edit: crossposted in Stackoverflow, since the question is not entirely WordPress-based; a solution could be used for nonWP sites.

1 Answer 1


For anyone that is lurking, I solved my issue. I wrote a plugin that allows you to export to a html file, or just show it on screen. It basically outputs all pages using minimal CSS (just H1/H2/H3) into an HTML file, or to the screen (or emails the file to you).

Another way, which I have also used, is to create a simple template that outputs the posts to the screen, again with minimal CSS, and no header/footer/sidebars. Images are placed in a table (for easier adjusting in Word). When I output the entire blog to screen (no pagination), then I do a Save As HTML in my browser. I open that in Word, save it as a DOCX, and then massage the DOCX into a format to be printed (I use Lulu to print the book).

All works well. A lot of editing required to make the printed copy look good, but the big part of exporting the WP posts is done with the process.

  • Should link your code repo here Dec 19, 2019 at 0:16
  • The process of using a template is theme-specific - just make a copy of the page template, and remove all the CSS stuff. Change the headings and meta to H1/H2. The basic code in the Loop should take care of post content and attached images. Creating a template actually works a bit better than my plugin. But for those interested in the plugin, it's here wordpress.org/plugins/blog-to-html in the WP Plugin repository. Dec 19, 2019 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.