All guides

Export WordPress blog posts as a book: a plugin you can build today

· 5 min read

A blog that has run for several years accumulates a lot of material. For some sites that material is good enough to repackage as a report, a client leave-behind, or an actual book. The problem is always assembly: WordPress shows posts in reverse-chronological order, not arranged into chapters, and there is no built-in way to pull selected posts into a single document.

Anthologize was the plugin that solved this. Built by the PressForward project at George Mason University, it could take a WordPress blog and export it as an ebook with a cover, chapters, and table of contents. Development stopped. The plugin works on old WordPress installations but is incompatible with Gutenberg, and no maintained alternative has taken its place.

What one build gives you

  • 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

What it does not do

  • 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 these. This covers the part most sites use.

The prompt

Loads into the composer so you can edit it first. Nothing is built, and nothing is charged, until you send it.

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().

Build this pluginAbout 55 credits · the free plan includes enough for one

What the plugin produces

A Steem build for this job adds a Posts > Export to Book admin page. The page has three parts.

At the top, input fields for book title, subtitle, and author name. Below that, a searchable list of posts from all post types with a checkbox and a chapter number field for each row. At the bottom, a Generate Book button.

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

How the PDF export works

The plugin does not generate a PDF file directly. Doing that on the server requires a library like DOMPDF or mPDF, which adds a large dependency and fails on hosts with limited PHP memory. Instead, the plugin generates a clean HTML page styled with a print stylesheet and adds a Print button at the top.

In any browser, File > Print > Save as PDF produces a clean multi-page PDF with proper margins and page breaks between chapters. On most operating systems this works without any additional software. The result is the same as what a dedicated PDF library produces for a document of this type.

How chapter order works

Posts are sorted by the chapter number you assign, not by publish date. You can set any number: 1 through 10, or higher if you want to leave gaps for future additions without renumbering.

The table of contents is generated from that same order, so what appears in the contents matches what appears in the document.

How to install and use it

Paste the prompt below into Steem and download the generated zip. Install it under Plugins > Add New > Upload Plugin. Once active, go to Posts > Export to Book.

Select the posts you want to include, assign chapter numbers, fill in the book title and author, and click Generate Book. Review the output in the new browser tab, then use your browser's print dialog to save it as a PDF.

Questions

Does this export Gutenberg blocks correctly?
Yes. The plugin renders post content through apply_filters('the_content'), which converts Gutenberg block markup to its HTML output before export. Headings, lists, and paragraph formatting come through correctly. Blocks that rely on JavaScript for interactivity render as their static HTML fallback.
Will images be included in the exported PDF?
Images embedded in post content are included, but they load from their original hosted URLs. A PDF saved while connected to the internet will include them. The plugin does not download or re-package images into the export.
Can I include pages or custom post types, not just blog posts?
Yes. The admin page lists posts from all registered post types, including pages and custom post types. Use the search field to find specific posts across all types.
Does the plugin produce an EPUB file like Anthologize did?
No. It produces a print-ready HTML page you save as PDF using your browser's print dialog. EPUB generation requires server-side library dependencies that make the plugin larger and harder to install.
How do I control which posts appear in the export?
You select them individually using the checkboxes on the admin page. Each selected post gets a chapter number field you set manually. Posts are sorted by that number in the final document.

The prompt

Loads into the composer so you can edit it first. Nothing is built, and nothing is charged, until you send it.

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().

Build this pluginAbout 55 credits · the free plan includes enough for one

Read next

Other plugins you can build this way

Each loads into the composer, ready to edit.