pdfLoaded PDF document loaded successfully
Everything you need to know to start sharing your PDFs professionally. Complete documentation for WordPress, Drupal and React / Next.js.
Install and configure the plugin in minutes
Install the Plugin
Via WordPress Admin:
Or via WP-CLI:
wp plugin install pdf-embed-seo-optimize --activate Upload Your First PDF
Configure Display Options
View Your PDF
Navigate to: PDF Documents > Settings
| Setting | Default |
|---|---|
| Allow Download by Default | Yes |
| Allow Print by Default | Yes |
| Auto-generate Thumbnails | Yes |
| Viewer Theme | Light |
| Viewer Height | 800px |
| Archive Posts per Page | 12 |
Help search engines find all your PDF documents automatically
Your PDF sitemap is available at:
yourdomain.com/pdf/sitemap.xml The plugin automatically creates a special sitemap just for your PDFs. This helps Google and other search engines discover and index all your documents, making them easier for customers to find.
Good to know: You can submit this sitemap to Google Search Console to help your documents appear in search results faster.
Embed PDFs anywhere on your site
Get PDF ID
Find it in PDF Documents list
Add Shortcode
Use [pdf_viewer id="X"]
Customize Size
Add width/height attributes
Publish
Save and preview your page
Embed a single PDF viewer.
| Attribute | Default | Description |
|---|---|---|
| id | Current post | PDF document ID |
| width | 100% | Viewer width |
| height | 800px | Viewer height |
[pdf_viewer id="123" width="100%" height="600px"] Display a list of all PDFs.
| Attribute | Default | Description |
|---|---|---|
| orderby | title | Sort: title, date, menu_order |
| order | ASC | Direction: ASC, DESC |
| limit | -1 | Number of PDFs (-1 for all) |
[pdf_viewer_sitemap orderby="date" order="DESC" limit="10"] Interactive form fields in your PDF viewer
AcroForms are interactive form fields embedded in PDF documents. When a PDF contains fillable fields (text inputs, checkboxes, radio buttons, dropdowns), the viewer automatically detects them and displays an interactive form toolbar.
This feature works with any PDF that contains standard AcroForm fields — no additional configuration is required. Simply upload your fillable PDF and the form toolbar appears automatically.
Upload PDF
Upload a PDF with AcroForm fields
Auto-Detection
Viewer detects form fields automatically
Fill Fields
Users fill in text, checkboxes, and dropdowns
Download / Print
Download or print the filled PDF
When a PDF with form fields is loaded, a blue toolbar appears below the main viewer toolbar with these controls:
| Button | Description |
|---|---|
| Form Fields Detected | Label indicating the PDF contains fillable form fields. Toolbar only appears when form fields are found. |
| Clear Form | Resets all form fields to their default empty state. Useful when users want to start over. |
| Download Filled PDF | Downloads the PDF with all filled-in form data embedded. Only shown when downloads are enabled for the document. |
Text Fields
Single-line and multi-line text inputs for names, addresses, comments, etc.
Checkboxes
Toggle checkboxes for yes/no options, agreements, and multi-select choices.
Radio Buttons
Single-select option groups where only one choice can be selected.
Dropdown Menus
Select menus with predefined options for structured data entry.
AcroForms work automatically with any PDF uploaded via the PDF Documents admin. No shortcode changes needed — forms are detected on page load.
Upload a fillable PDF via the PDF Document entity form. The viewer template includes the annotation layer and form toolbar out of the box.
The PdfViewer component handles AcroForms automatically. Form fields render as interactive overlays when detected in the loaded PDF.
Base URL: /wp-json/pdf-embed-seo/v1/
List all published PDF documents.
| Parameter | Type | Description |
|---|---|---|
| page | int | Page number (default: 1) |
| per_page | int | Items per page (max 100) |
| search | string | Search term |
| orderby | string | date, title, modified, views |
Get single PDF document details.
Returns: id, title, slug, url, description, thumbnail, file_size, page_count, view_count, dates
Get secure PDF URL for viewer (AJAX-based).
Returns: success, url (temporary secure URL), expires
Track a PDF view (increment view counter).
Get public plugin settings (viewer theme, height, permissions).
GET /analytics Dashboard summary (total views, unique visitors, popular docs)GET /analytics/documents Per-document analyticsGET /analytics/export Export data (CSV/JSON)GET /documents/{id}/progress Get reading progressPOST /documents/{id}/progress Save reading progress (page, scroll, zoom)POST /documents/{id}/verify-password Verify password for protected PDFsPOST /documents/{id}/download Track PDF downloadPOST /documents/{id}/expiring-link Generate expiring access link{ "id": 123, "title": "Annual Report 2024", "slug": "annual-report-2024", "url": "https://example.com/pdf/annual-report-2024/", "excerpt": "Company annual report...", "date": "2024-01-15T10:30:00+00:00", "views": 1542, "thumbnail": "https://example.com/wp-content/uploads/thumb.jpg"
} Extend and customize the plugin functionality
pdf_embed_seo_pdf_viewed Fired when PDF is viewed ($post_id, $count) pdf_embed_seo_premium_init Premium features initialized pdf_embed_seo_settings_saved Settings saved pdf_embed_seo_schema_data Modify Schema.org data for a single PDF pdf_embed_seo_archive_schema_data Modify Schema.org data for archive page pdf_embed_seo_archive_query Modify archive page posts per page pdf_embed_seo_sitemap_query_args Modify sitemap shortcode query args pdf_embed_seo_archive_title Modify the archive page title pdf_embed_seo_archive_description Modify the archive page description pdf_embed_seo_viewer_options Modify PDF.js viewer options pdf_embed_seo_allowed_types Modify allowed MIME types for upload pdf_embed_seo_rest_document Modify REST API document response pdf_embed_seo_rest_document_data Modify REST API document data pdf_embed_seo_rest_settings Modify REST API settings response add_filter( 'pdf_embed_seo_schema_data', function( $schema, $post_id ) { $schema['author'] = [ '@type' => 'Person', 'name' => get_post_meta( $post_id, '_pdf_author', true ), ]; return $schema;
}, 10, 2 ); Customize the look and feel
Copy Template Files
Available Template Files
single-pdf_document.php Controls single PDF page layout, viewer placement, and metadata display archive-pdf_document.php Controls PDF archive/listing page with grid or list view content-pdf_document.php Individual PDF card in archive listings Customize with CSS
Add custom styles to your theme's style.css:
/* Custom PDF viewer styling */
.pdf-viewer-container { border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/* PDF archive grid */
.pdf-archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem;
} Use Template Tags
Available template tags for your custom templates:
pdf_embed_seo_get_viewer() - Output the PDF viewerpdf_embed_seo_get_thumbnail() - Get PDF thumbnail URLpdf_embed_seo_get_download_url() - Get secure download URLpdf_embed_seo_get_page_count() - Get PDF page countpdf_embed_seo_get_view_count() - Get view countExtend and integrate PDF Embed with hooks, REST API, and webhooks
| Feature | Class |
|---|---|
| Analytics Dashboard | Premium_Analytics |
| Password Protection | Premium_Password |
| Detailed View Tracking | Premium_Tracking |
| Reading Progress | Premium_Progress |
| XML Sitemap | Premium_Sitemap |
| PDF Categories & Tags | Premium_Taxonomies |
| CSV/JSON Export | Premium_Export |
| Role-Based Access | Premium_Roles |
| Bulk Import | Premium_Bulk |
| Full REST API | Premium_API |
| White-Label Options | Premium_WhiteLabel |
pdf_embed_seo_pdf_viewed action Fires after a PDF is viewed with post ID and view count
add_action( 'pdf_embed_seo_pdf_viewed', function( $post_id, $count ) { // Your code here
}, 10, 2 ); pdf_embed_seo_schema_data filter Modify Schema.org DigitalDocument data for a single PDF
add_filter( 'pdf_embed_seo_schema_data', function( $schema, $post_id ) { $schema['author'] = [ '@type' => 'Person', 'name' => get_post_meta( $post_id, '_author', true ), ]; return $schema;
}, 10, 2 ); pdf_embed_seo_viewer_options filter Modify PDF.js viewer options
add_filter( 'pdf_embed_seo_viewer_options', function( $options, $post_id ) { $options['defaultZoom'] = 'page-fit'; return $options;
}, 10, 2 ); pdf_embed_seo_rest_document filter Modify REST API document response
add_filter( 'pdf_embed_seo_rest_document', function( $data, $post, $detailed ) { $data['custom_field'] = get_post_meta( $post->ID, '_custom', true ); return $data;
}, 10, 3 ); | Method | Endpoint | Tier |
|---|---|---|
| GET | /documents | |
| GET | /documents/{id} | |
| GET | /documents/{id}/data | |
| GET | /analytics | Premium |
| POST | /documents/{id}/expiring-link | Premium |
| POST | /bulk/import | Premium |
Listen for viewer events to build custom integrations.
pdfLoaded PDF document loaded successfully
pageRendered A page has been rendered
pageChanged User navigated to a different page
zoomChanged Zoom level was changed
Advanced functionality for Pro users