Export WordPress blog posts as a book

Published Updated 2 min read

A blog that has run for years builds up a lot of material, and some of it is good enough to repackage as a report, a client leave-behind or an actual book. The hard part is always assembly: WordPress shows posts newest first, not in chapters, and has no way to pull chosen posts into one document.

Anthologize solved this. Built by the PressForward project at George Mason University, it exported a blog as an ebook with a cover, chapters and a table of contents. Development stopped, it is incompatible with Gutenberg, and no maintained alternative has taken its place.

Title, chapters and a Generate button

The plugin adds Posts > Export to Book. At the top are fields for the book's title, subtitle and author. Below is a searchable list of posts from every post type, pages and custom types included, each with a checkbox and a chapter number. At the bottom is Generate Book.

Generate opens a new tab with a print-ready HTML document: a cover page, a table of contents with jump links, and each selected post as a numbered chapter with its title, original publication date and full content.

Content goes through apply_filters('the_content'), so Gutenberg blocks arrive as their HTML output, with headings, lists and paragraphs intact. Blocks that depend on JavaScript for interaction appear as their static fallback.

Generating a PDF on the server needs a library like DOMPDF or mPDF, which is a heavy dependency and fails on hosts with little PHP memory. Instead the plugin builds a clean HTML page with a print stylesheet and a Print button at the top.

File > Print > Save as PDF in any browser gives a multi-page PDF with proper margins and a page break between chapters, with no extra software on most systems. For a document like this, the result matches what a PDF library would produce.

Images in post content load from their original URLs rather than being packaged into the export, so save the PDF while online. Featured images are not included, only images inside the content.

Chapter numbers, not publish dates

Posts appear in the order of the chapter numbers you give them, not by date. Use 1 to 10, or leave gaps so you can slot chapters in later without renumbering.

The table of contents is built from the same order, so the contents always match the book.

What you get

Included

  • An admin page where you select posts from any post type and assign chapter numbers
  • A print-ready HTML document with a cover page, table of contents, and numbered chapters
  • Posts rendered through the WordPress content filter so Gutenberg block output is included
  • A Print button at the top of the document that triggers the browser print-to-PDF dialog

Not included

  • Direct PDF or EPUB file generation: the output is a print-ready HTML page you save as PDF through the browser
  • Featured images: only images already embedded in post content are included
  • Custom branding or styling beyond the built-in print stylesheet
  • Image packaging: images load from their original hosted URLs, so printing needs an internet connection to render them
  • Scheduled or automated exports: each export is generated on demand from the admin page

Anthologize does the things on the right. This build covers the part most sites use.

Questions

Does it produce an EPUB like Anthologize did?

No. It produces a print-ready HTML page that you save as a PDF from the browser's print dialog. EPUB generation needs server-side libraries that would make the plugin larger and harder to install.

Build it in Steem

The button opens the builder with this guide's prompt filled in, so you can change anything before it runs. Nothing is built, and nothing is charged, until you send it.

Build this pluginAbout 55 credits. The free plan includes enough for one.
Read the prompt (185 words)

Build a WordPress plugin that adds a Posts > Export to Book admin page under the Posts menu. At the top of the page add input fields for book title, subtitle, and author name. Below that, add a searchable table listing all posts from all registered post types with a checkbox on each row and a number input labeled Chapter beside each checked row. Add a Generate Book button that opens a new browser tab containing a print-ready HTML document with: a styled cover page showing the book title, subtitle, author name, and today's date; a table of contents listing each selected post in chapter-number order with anchor jump links; each selected post rendered as a chapter using apply_filters on the_content, with the chapter number as a large heading above the post title, the original publication date in small text below the title, and the full rendered post content. Add a print stylesheet that sets comfortable margins, hides browser header and footer chrome, and inserts a page break before each chapter. Add a Print button fixed to the top of the page that calls window.print().