WP Manifestindependent plugin directory
manifest / content / wordpressplugin-export-articles-to-pdf

Export articles to PDF

Mass export of selected WordPress post types to PDF with async regeneration on updates.

by WhyMe · github.com/dmitriy-whyme/wordpressplugin-export-articles-to-pdf

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/dmitriy-whyme/wordpressplugin-export-articles-to-pdf/archive/refs/heads/main.zip

Export Articles to PDF for WordPress

Generate PDF files from WordPress posts and custom post types at scale, then keep them updated automatically when content changes.

If this plugin saves your team time, please star the repo to support maintenance.

🚀 Features

  • 📄 Export posts and public custom post types to PDF
  • 🔁 Auto-regenerate PDFs when enabled content is updated
  • 🧠 Skip unchanged content using hash-based export checks
  • 📦 Batch generation from the WordPress admin (50 posts per batch)
  • ⚡ Async queueing with Action Scheduler (falls back to sync mode)
  • 🖥 WP-CLI commands for bulk and per-post queueing
  • 🗂 Store PDFs in wp-content/uploads/export-articles-to-pdf/{post_type}/
  • 🔗 Create or update a media attachment linked to each source post
  • 🧹 Clean up generated files when posts are trashed or deleted

📦 Installation

Option A: Install prebuilt ZIP (recommended)

  1. In WordPress Admin, go to Plugins -> Add New -> Upload Plugin.
  2. Upload dist/export-articles-to-pdf.zip.
  3. Activate Export articles to PDF.

Option B: Install from source

  1. Clone/copy this repo to: wp-content/plugins/export-articles-to-pdf
  2. Install dependencies:
composer install --no-dev -o
  1. Activate the plugin from WordPress Admin.

🛠 Usage

Admin UI

  1. Go to Tools -> Export articles to PDF.
  2. Select post types to export.
  3. Click a Generate PDF X-Y button to process a batch.

WP-CLI

wp kb-exporter queue-all
wp kb-exporter queue-post <post_id>
  • queue-all: force-queues all exportable posts from enabled post types.
  • queue-post <post_id>: queues one post if it is valid and enabled.

⚙️ Configuration

  • Saved option key: kb_exporter_post_types
  • Export file pattern: {post_id}.pdf
  • Export directory pattern: uploads/export-articles-to-pdf/{post_type}/
  • If Action Scheduler is unavailable, exports run synchronously.
  • If mpdf/mpdf is missing, generation is blocked until dependencies are installed.

Export metadata keys

  • _kb_export_pdf_attachment_id
  • _kb_export_pdf_file_path
  • _kb_export_pdf_file_url
  • _kb_export_last_exported_at
  • _kb_export_last_queue_at
  • _kb_export_last_hash
  • _kb_export_last_error

📸 Screenshots

Add screenshots in assets/screenshots/ and reference them here:

  • Settings screen (Tools -> Export articles to PDF)
  • Batch generation buttons by selected post count
  • Success/error notices after generation
  • Media attachment linked to source post

📌 Use Cases

  • Knowledge base teams that need downloadable article PDFs
  • Membership or internal documentation sites
  • Legal/compliance teams requiring offline snapshots
  • Agencies exporting client content archives in PDF format

🤝 Contributing

Contributions are welcome. Please read CONTRIBUTING.md before opening a PR.

Compatibility

  • WordPress 6.4+
  • PHP 7.4+

Changelog

See CHANGELOG.md.

📄 License

This project is licensed under GPL-2.0-or-later. See LICENSE.