How to Embed PDF Files in WordPress? Embedding PDF files in WordPress is easy using the built-in tools, without plugins. You can also use the classic HTML embed code if needed.
Method 1: Using WordPress Media Library (Gutenberg)
- Login to your WordPress dashboard.
- Create a new post or edit an existing post.
- Click the + Add Block button and search for File or PDF.
- Upload your PDF file or select an existing PDF from the Media Library.
- The block will automatically insert a download link and an optional embed preview of the PDF.
- Publish or update your post. Visitors can now view or download the PDF directly.
Method 2: Using HTML Embed Tag
If you want to embed the PDF directly inside the post for inline viewing, you can use the HTML <embed> tag:
<embed src="https://yoursite.com/wp-content/uploads/yourfile.pdf" width="600" height="500" type="application/pdf">
Replace https://yoursite.com/wp-content/uploads/yourfile.pdf with the actual URL of your PDF file.
Method 3: Using a Plugin (Optional)
If you want advanced features like pagination, search, or zoomable PDF viewing, you can install a plugin like:
These plugins allow you to embed PDFs using a shortcode or block, with better compatibility across themes and devices.