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.zipExport 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.