Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/dmitriy-whyme/wordpressplugin-export-articles-to-pdf/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
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 (
50posts 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)
- In WordPress Admin, go to
Plugins -> Add New -> Upload Plugin. - Upload
dist/export-articles-to-pdf.zip. - Activate Export articles to PDF.
Option B: Install from source
- Clone/copy this repo to:
wp-content/plugins/export-articles-to-pdf - Install dependencies:
composer install --no-dev -o
- Activate the plugin from WordPress Admin.
🛠 Usage
Admin UI
- Go to
Tools -> Export articles to PDF. - Select post types to export.
- Click a
Generate PDF X-Ybutton 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/mpdfis 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.