WordPress is a modern, flexible website publishing platform. One way you can see this is through how it handles media. You can upload almost any type of file to your site through the media library, but for some files you need some extra support. If you want to learn how to embed PDF files in WordPress, you need more steps than simple image or video embedding.
Since WordPress only offers generic embedding, you’ll need a server to host files or install plugins for most use cases. The good news is that both solutions are suitable and, most importantly, easy to implement.
In this article, we will show you how to embed PDF files in WordPress using Google Drive, WordPress blocks and plugins. First, it’s worth discussing why you want to embed a PDF, and pointing out the difference between simple uploading and embedding.
Why embed PDF files in WordPress?
You probably already know why you should embed PDF files in WordPress, although you may not understand the benefits you will get. There are many, here are just a few:
PDFs are great for use as a sampler for a complete product or service. For example, if you are a graphic designer or writer, you can make a PDF to download.
Depending on the content, some PDFs work well as reusable elements. A registration form is a good example, or a terms and conditions document.
If you commission white papers or reports, you don’t have to enter them into WordPress. Instead, you can provide files for download or viewing.
This last point presents common use cases for PDFs. For example, due to the time-consuming nature of conversion, you may not want to recreate valuable PDFs as articles on your website. However, you can embed the file and retain all the dynamic and interactive elements of the native content.
Difference between embedding and uploading PDF files?
This may seem obvious to some, but there is a difference between embedding a PDF file and uploading a PDF file. Yes, you can upload any file to WordPress (except SVG as of this writing), but that doesn’t mean you can view it.
To do this, you need some way for WordPress to “talk” to the file to display it. That’s where a dedicated PDF viewer comes into play. In the past, WordPress has not been the best when it comes to embedding files. But, with the block editor, you’ll get a more consistent workflow that’s more in line with other media types in WordPress – more on that later.
How to embed PDF files in WordPress?
In order to embed PDF files in WordPress, we will cover three methods. Each will suit different applications and workflows. So your choice is a personal decision:
If you use Google Drive to host your files, you may want to add the embed code to your WordPress HTML.
The WordPress block editor has a way to view PDFs, which is probably all you need to display them on the front end.
Plugins such as PDF Embedder allow you to display PDFs and provide readers with a fully functional experience.
The solutions we provide are in no order, and none is more “correct” than the other. So look at each one and choose one that suits your overall goals.
1. Embed files using Google Drive
Many website owners use Google products, and for those invested in the ecosystem, you will understand the importance of Google Drive.
2. Use WordPress Blocks to Add Viewable PDF Files to Your Site
Compared to the old classic editor, the block editor allows you to work with various media types in a consistent manner. This is most evident when you embed PDF files in WordPress.
3. Use a plugin to embed PDF files in WordPress
If you want to regularly embed PDF files in WordPress, or if you want to provide a top-notch reading experience, then plugins are the way to go. There are several to choose from, in fact, any option will be a good solution.